Skip to content

Commit

Permalink
move Qt floor from 5.12 to 5.15 (#1199)
Browse files Browse the repository at this point in the history
* move Qt floor to 5.15.

* fix focal, coverage, windows 32 bit builds.

* try harder to fix coverage build

* fix codeql build

* kill fedora 32 CI build which uses Qt 5.14.
  • Loading branch information
tsteven4 authored Oct 28, 2023
1 parent c95e1cf commit ae4ac82
Show file tree
Hide file tree
Showing 17 changed files with 25 additions and 54 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
name: Analyze
runs-on: ubuntu-latest
container:
image: gpsbabel-docker.jfrog.io/tsteven4/gpsbabel_build_environment_focal
image: gpsbabel-docker.jfrog.io/tsteven4/gpsbabel_build_environment_jammy
env:
CMAKE_GENERATOR: Ninja

Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/fedora.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ jobs:
strategy:
fail-fast: false
matrix:
# version 32, though obsolete, uses Qt 5.14 so we keep it for that.
include:
- IMAGE: '32'
CMAKE_PREFIX_PATH: '/usr/lib64/cmake/Qt5'
- IMAGE: '35'
CMAKE_PREFIX_PATH: '/usr/lib64/cmake/Qt5'
- IMAGE: '37'
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ jobs:
fail-fast: false
matrix:
include:
- IMAGE: 'focal'
SCRIPT: './tools/build_and_test_cmake.sh'
# focal has Qt 5.12, end of standard support 4/2025, end of life 4/2030.
#- IMAGE: 'focal'
# SCRIPT: './tools/build_and_test_cmake.sh'
- IMAGE: 'jammy'
CMAKE_PREFIX_PATH: '/usr/lib/x86_64-linux-gnu/cmake/Qt5'
SCRIPT: './tools/build_and_test_cmake.sh'
Expand Down Expand Up @@ -63,12 +64,12 @@ jobs:
coverage:
name: coverage Build
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- name: install
run: |
sudo apt-get update
sudo apt-get install gcovr lcov libusb-1.0-0-dev qt5-default qtwebengine5-dev libqt5serialport5-dev ninja-build
sudo apt-get install gcovr lcov libusb-1.0-0-dev qtbase5-dev qtwebengine5-dev libqt5serialport5-dev ninja-build
- name: Checkout repository
uses: actions/checkout@v4
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,27 @@ jobs:
fail-fast: false
matrix:
include:
- QT_VERSION: '5.12.12'
- QT_VERSION: '5.15.2'
ARCH: 'amd64'
HOST_ARCH: 'amd64'
COMPILER: 'msvc2017_64'
COMPILER: 'msvc2019_64'
METHOD: 'aqt'
GENERATOR: 'Visual Studio 16 2019'
RELEASE: false
os: windows-2019
- QT_VERSION: '5.12.12'
- QT_VERSION: '5.15.2'
ARCH: 'amd64'
HOST_ARCH: 'amd64'
COMPILER: 'msvc2017_64'
COMPILER: 'msvc2019_64'
TOOLSET: 'v141,version=14.16.27023'
METHOD: 'aqt'
GENERATOR: 'Visual Studio 16 2019'
RELEASE: false
os: windows-2019
- QT_VERSION: '5.12.12'
- QT_VERSION: '5.15.2'
ARCH: 'x86'
HOST_ARCH: 'amd64'
COMPILER: 'msvc2017'
COMPILER: 'msvc2019'
METHOD: 'aqt'
GENERATOR: 'Visual Studio 16 2019'
RELEASE: false
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ add_executable(gpsbabel)
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core REQUIRED)
list(APPEND QT_LIBRARIES Qt${QT_VERSION_MAJOR}::Core)
if(${Qt${QT_VERSION_MAJOR}Core_VERSION} VERSION_LESS 5.12)
message(FATAL_ERROR "Qt version ${Qt${QT_VERSION_MAJOR}Core_VERSION} found, but version 5.12 or newer is required.")
if(${Qt${QT_VERSION_MAJOR}Core_VERSION} VERSION_LESS 5.15)
message(FATAL_ERROR "Qt version ${Qt${QT_VERSION_MAJOR}Core_VERSION} found, but version 5.15 or newer is required.")
else()
message(STATUS "Using Qt${QT_VERSION_MAJOR} version ${Qt${QT_VERSION_MAJOR}Core_VERSION}")
endif()
Expand Down
4 changes: 2 additions & 2 deletions gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ endif()
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Gui Network SerialPort Widgets Xml REQUIRED)
list(APPEND QT_LIBRARIES Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Network Qt${QT_VERSION_MAJOR}::SerialPort Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Xml)
if(${Qt${QT_VERSION_MAJOR}Core_VERSION} VERSION_LESS 5.12)
message(FATAL_ERROR "Qt version ${Qt${QT_VERSION_MAJOR}Core_VERSION} found, but version 5.12 or newer is required.")
if(${Qt${QT_VERSION_MAJOR}Core_VERSION} VERSION_LESS 5.15)
message(FATAL_ERROR "Qt version ${Qt${QT_VERSION_MAJOR}Core_VERSION} found, but version 5.15 or newer is required.")
else()
message(STATUS "Using Qt${QT_VERSION_MAJOR} version ${Qt${QT_VERSION_MAJOR}Core_VERSION}")
endif()
Expand Down
4 changes: 0 additions & 4 deletions igc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -688,11 +688,7 @@ void IgcFormat::wr_header()
// Other header data may have been stored in track description
if (track && track->rte_desc.startsWith(HDRMAGIC)) {
QString desc = track->rte_desc.mid(QString(HDRMAGIC).size());
#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0))
const QStringList fields = desc.split(HDRDELIM, QString::SkipEmptyParts);
#else
const QStringList fields = desc.split(HDRDELIM, Qt::SkipEmptyParts);
#endif
for (const auto& field : fields) {
gbfprintf(file_out, "%s\r\n", CSTR(field));
}
Expand Down
2 changes: 1 addition & 1 deletion main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,7 @@ main(int argc, char* argv[])
// MIN_QT_VERSION in GPSBabel.pro should correspond to the QT_VERSION_CHECK
// arguments in main.cc and gui/main.cc and the version check in
// CMakeLists.txt, gui/CMakeLists.txt.
#if (QT_VERSION < QT_VERSION_CHECK(5, 12, 0))
#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0))
#error This version of Qt is not supported.
#endif

Expand Down
4 changes: 0 additions & 4 deletions shape.cc
Original file line number Diff line number Diff line change
Expand Up @@ -218,11 +218,7 @@ ShapeFormat::read()
if (qopt_name.contains('+')) {
// form a compound name from one or more fields.
nameidx = -2;
#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0))
const QStringList opt_name_fields = qopt_name.split('+', QString::SkipEmptyParts);
#else
const QStringList opt_name_fields = qopt_name.split('+', Qt::SkipEmptyParts);
#endif
nameindices.reserve(opt_name_fields.size());
for (int oidx=0; oidx<opt_name_fields.size(); oidx++) {
bool ok;
Expand Down
13 changes: 0 additions & 13 deletions src/core/logging.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,4 @@ class Debug : public QDebug
explicit Debug(int l) : QDebug(QtDebugMsg) {nospace().noquote() << DebugIndent(l);}
};

/*
* Kludge any used QTextStream modifiers into Qt namespace as they are in newer
* versions of Qt. This makes source compatiblity easier.
*/
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
namespace Qt
{
inline QTextStream& dec(QTextStream &s) { return ::dec(s); }
inline QTextStream& hex(QTextStream &s) { return ::hex(s); }
inline QTextStream& endl(QTextStream &s) { return ::endl(s); }
inline QTextStream& uppercasedigits(QTextStream &s) { return ::uppercasedigits(s); }
}
#endif
#endif // SRC_CORE_LOGGING_H_
6 changes: 4 additions & 2 deletions tools/ci_install_windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ function validate() {
)
}

QT_VERSION=${1:-5.12.10}
COMPILER=${2:-msvc2017_64}
QT_VERSION=${1:-5.15.2}
COMPILER=${2:-msvc2019_64}
METHOD=${3:-default}

if [ "${COMPILER}" = "msvc2017_64" ]; then
Expand All @@ -28,6 +28,8 @@ elif [ "${COMPILER}" = "msvc2017" ]; then
PACKAGE_SUFFIX=win32_msvc2017
elif [ "${COMPILER}" = "msvc2019_64" ]; then
PACKAGE_SUFFIX=win64_msvc2019_64
elif [ "${COMPILER}" = "msvc2019" ]; then
PACKAGE_SUFFIX=win32_msvc2019
else
echo "ERROR: unrecognized Qt compiler ${COMPILER}." >&2
exit 1
Expand Down
2 changes: 1 addition & 1 deletion tools/ci_setup_windows.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# and https://github.com/microsoft/vswhere/wiki/Start-Developer-Command-Prompt

Param(
[string] $qtdir = "C:\Qt\Qt5.12.10\5.12.10\msvc2017_64",
[string] $qtdir = "C:\Qt\Qt5.15.2\5.15.2\msvc2019_64",
[ValidateSet("x86", "amd64")][string] $arch = "amd64",
[ValidateSet("x86", "amd64")][string] $host_arch = "amd64",
[string] $vcversion
Expand Down
2 changes: 1 addition & 1 deletion tools/make_docker_qtio_image
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
versuffix=_qtio
tag=$(date -u +%Y%m%dT%H%M%SZ)

QT_VERSION=5.12.10
QT_VERSION=5.15.2
QT_VERSION_SHORT=${QT_VERSION//./}
QT_CI_PACKAGES="qt.qt5.${QT_VERSION_SHORT}.gcc_64,qt.qt5.${QT_VERSION_SHORT}.qtwebengine"
DOWNLOAD_URL=$(./qtci/find_qt_installer ${QT_VERSION})
Expand Down
2 changes: 1 addition & 1 deletion tools/travis_install_linux_coverage
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function validate() {
)
}

QT_VERSION=${1:-5.12.2}
QT_VERSION=${1:-5.15.2}
QT_VERSION_SHORT=${QT_VERSION//./}

# our expectation is that install-qt creates $QTDIR, $QTDIR/bin.
Expand Down
2 changes: 1 addition & 1 deletion tools/travis_install_linux_local
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function validate() {
)
}

QT_VERSION=${1:-5.12.2}
QT_VERSION=${1:-5.15.2}
QT_VERSION_SHORT=${QT_VERSION//./}

# our expectation is that install-qt creates $QTDIR, $QTDIR/bin.
Expand Down
4 changes: 0 additions & 4 deletions util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -345,11 +345,7 @@ make_datetime(QDate date, QTime time, bool is_localtime, bool force_utc, int utc
result = QDateTime(QDate(1970, 1, 1), time, timespec, offset);
} else if (date.isValid()) {
// no time, use start of day in the given Qt::TimeSpec.
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
result = QDateTime(date, QTime(0,0), timespec, offset);
#else
result = date.startOfDay(timespec, offset);
#endif
}

return result;
Expand Down
4 changes: 0 additions & 4 deletions xcsv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -646,11 +646,7 @@ XcsvFormat::xcsv_parse_val(const QString& value, Waypoint* wpt, const XcsvStyle:
case XcsvStyle::XT_GEOCACHE_LAST_FOUND: {
QDate date;
date = yyyymmdd_to_time(value);
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
wpt->AllocGCData()->last_found = QDateTime(date);
#else
wpt->AllocGCData()->last_found = date.startOfDay();
#endif
break;
}

Expand Down

0 comments on commit ae4ac82

Please sign in to comment.