CMake+etc: Enable Qt6 by default for Unix builds

Linux builds were left behind on the Qt transition, presumably because
our Ubuntu CI image does not support Qt6.

Enable Qt6 by default and explicitly disable it for slower or more
conservative Linux distros.

Drop experimental status for Qt6, because we are using it to build
official Windows and macOS releases.
This commit is contained in:
João Valverde 2022-08-22 08:57:46 +01:00 committed by Roland Knall
parent 6b35aa0773
commit b33210750c
8 changed files with 24 additions and 24 deletions

View File

@ -118,7 +118,7 @@ variables:
script:
# setcap restricts our library paths
- printf "\e[0Ksection_start:%s:cmake_section[collapsed=true]\r\e[0KRunning CMake" "$( date +%s)"
- CFLAGS=-Wl,-rpath=$(pwd)/run CXXFLAGS=-Wl,-rpath=$(pwd)/run cmake -GNinja -DENABLE_CCACHE=ON $CMAKE_ARGS ..
- CFLAGS=-Wl,-rpath=$(pwd)/run CXXFLAGS=-Wl,-rpath=$(pwd)/run cmake -GNinja -DENABLE_CCACHE=ON -DUSE_qt6=OFF $CMAKE_ARGS ..
- printf "\e[0Ksection_end:%s:cmake_section\r\e[0K" "$( date +%s)"
- ninja
- ninja install
@ -187,7 +187,7 @@ Source Package:
script:
- ../tools/make-version.py --set-release ..
- printf "\e[0Ksection_start:%s:cmake_section[collapsed=true]\r\e[0KRunning CMake" "$( date +%s)"
- cmake -G Ninja $CMAKE_ARGS -DENABLE_CCACHE=ON ..
- cmake -G Ninja $CMAKE_ARGS -DENABLE_CCACHE=ON -DUSE_qt6=OFF ..
- printf "\e[0Ksection_end:%s:cmake_section\r\e[0K" "$( date +%s)"
- cd $CI_PROJECT_DIR
- build/packaging/source/git-export-release.sh -d .
@ -332,7 +332,7 @@ Win64 Package:
- cd build
script:
- C:\Windows\py.exe ..\tools\make-version.py --set-release ..
- cmake -G "Visual Studio 17 2022" -A x64 -DUSE_qt6=ON -DENABLE_LTO=off ..
- cmake -G "Visual Studio 17 2022" -A x64 -DENABLE_LTO=off ..
- msbuild /verbosity:minimal "/consoleloggerparameters:PerformanceSummary;NoSummary" /maxcpucount Wireshark.sln
- msbuild /verbosity:minimal /maxcpucount test-programs.vcxproj
- msbuild /verbosity:minimal /maxcpucount wireshark_nsis_prep.vcxproj
@ -372,7 +372,7 @@ macOS Arm Package:
- mkdir build
- cd build
- printf "\e[0Ksection_start:%s:cmake_section[collapsed=true]\r\e[0KRunning CMake" "$( date +%s)"
- cmake -DENABLE_CCACHE=ON -DUSE_qt6=ON -DCMAKE_APPLE_SILICON_PROCESSOR=arm64 -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 -DCMAKE_OSX_ARCHITECTURES=arm64 -DTEST_EXTRA_ARGS=--enable-release -G Ninja ..
- cmake -DENABLE_CCACHE=ON -DCMAKE_APPLE_SILICON_PROCESSOR=arm64 -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 -DCMAKE_OSX_ARCHITECTURES=arm64 -DTEST_EXTRA_ARGS=--enable-release -G Ninja ..
- printf "\e[0Ksection_end:%s:cmake_section\r\e[0K" "$( date +%s)"
- ninja
- package-prep
@ -406,7 +406,7 @@ macOS Intel Package:
- mkdir build
- cd build
- printf "\e[0Ksection_start:%s:cmake_section[collapsed=true]\r\e[0KRunning CMake" "$( date +%s)"
- cmake -DENABLE_CCACHE=ON -DUSE_qt6=ON -DCMAKE_OSX_DEPLOYMENT_TARGET=10.14 -DCMAKE_OSX_SYSROOT=macosx10.15 -DTEST_EXTRA_ARGS=--enable-release -G Ninja ..
- cmake -DENABLE_CCACHE=ON -DCMAKE_OSX_DEPLOYMENT_TARGET=10.14 -DCMAKE_OSX_SYSROOT=macosx10.15 -DTEST_EXTRA_ARGS=--enable-release -G Ninja ..
- printf "\e[0Ksection_end:%s:cmake_section\r\e[0K" "$( date +%s)"
- ninja
- package-prep
@ -500,7 +500,7 @@ GCC Warnings:
script:
# build-ubuntu puts us in `build`.
- printf "\e[0Ksection_start:%s:cmake_section[collapsed=true]\r\e[0KRunning CMake" "$( date +%s)"
- CC=gcc CXX=g++ cmake -DENABLE_EXTRA_COMPILER_WARNINGS=on -DCMAKE_EXPORT_COMPILE_COMMANDS=on -DENABLE_CCACHE=ON -G Ninja ..
- CC=gcc CXX=g++ cmake -DENABLE_EXTRA_COMPILER_WARNINGS=on -DCMAKE_EXPORT_COMPILE_COMMANDS=on -DENABLE_CCACHE=ON -DUSE_qt6=OFF -G Ninja ..
- printf "\e[0Ksection_end:%s:cmake_section\r\e[0K" "$( date +%s)"
- script --command ninja --flush --quiet --return ../gcc_report.txt
- ansi2html < ../gcc_report.txt > ../gcc_report.html
@ -530,7 +530,7 @@ Code Checks + Clang Warnings:
- cd build
- printf "\e[0Ksection_start:%s:cmake_section[collapsed=true]\r\e[0KRunning CMake" "$( date +%s)"
# We don't have an "All options" job, so build fuzzshark and tfshark here.
- cmake -DENABLE_EXTRA_COMPILER_WARNINGS=on -DENABLE_CHECKHF_CONFLICT=on -DCMAKE_EXPORT_COMPILE_COMMANDS=on -DBUILD_fuzzshark=ON -DBUILD_tfshark=On -DBUILD_logray=ON -DENABLE_CCACHE=ON -G Ninja ..
- cmake -DENABLE_EXTRA_COMPILER_WARNINGS=on -DENABLE_CHECKHF_CONFLICT=on -DCMAKE_EXPORT_COMPILE_COMMANDS=on -DBUILD_fuzzshark=ON -DBUILD_tfshark=On -DBUILD_logray=ON -DENABLE_CCACHE=ON -DUSE_qt6=OFF -G Ninja ..
- printf "\e[0Ksection_end:%s:cmake_section\r\e[0K" "$( date +%s)"
- mkdir ../html
- script --command ninja --flush --quiet --return ../tmp_clang_report.txt
@ -555,7 +555,7 @@ No options:
extends: .build-ubuntu
rules: !reference [.if-merge-request]
script: |
cmake -GNinja -DENABLE_CCACHE=ON \
cmake -GNinja -DENABLE_CCACHE=ON -DUSE_qt6=OFF \
-DENABLE_BROTLI=OFF -DENABLE_CAP=OFF -DENABLE_CARES=OFF -DENABLE_CHECKHF_CONFLICT=ON -DENABLE_GNUTLS=OFF \
-DENABLE_KERBEROS=OFF -DENABLE_LIBXML2=OFF -DENABLE_ILBC=OFF -DENABLE_LUA=OFF -DENABLE_LZ4=OFF -DENABLE_MINIZIP=OFF \
-DENABLE_NETLINK=OFF -DENABLE_NGHTTP2=OFF -DENABLE_PCAP=OFF -DENABLE_PLUGIN_IFDEMO=ON -DENABLE_PLUGINS=OFF \
@ -570,7 +570,7 @@ Windows Build:
tags:
- wireshark-windows-merge-req
script:
- cmake -G "Visual Studio 17 2022" -A x64 -DUSE_qt6=ON -DENABLE_LTO=off ..
- cmake -G "Visual Studio 17 2022" -A x64 -DENABLE_LTO=off ..
- msbuild /verbosity:minimal /maxcpucount Wireshark.sln
- msbuild /verbosity:minimal /maxcpucount test-programs.vcxproj
- ctest -C RelWithDebInfo --parallel 3 --force-new-ctest-process --output-on-failure
@ -642,7 +642,7 @@ Coverity Visual C++ Scan:
- $gitDescription = (( git describe --tags ) | Out-String).Trim()
- C:\Windows\System32\curl --output $env:temp\cov-analysis-win64.zip --form project=$COVERITY_SCAN_PROJECT_NAME --form token=$COVERITY_SCAN_TOKEN https://scan.coverity.com/download/win64
- C:\ProgramData\chocolatey\tools\7z x "$env:temp\cov-analysis-win64.zip" -y -r -o"$env:temp"
- cmake -DTEST_EXTRA_ARGS=--enable-release -DUSE_qt6=ON -DENABLE_LTO=off -G "Visual Studio 17 2022" -A x64 ..
- cmake -DTEST_EXTRA_ARGS=--enable-release -DENABLE_LTO=off -G "Visual Studio 17 2022" -A x64 ..
- $covAnalysisWin64 = (Get-ChildItem -Path $env:temp -Filter "cov-analysis-win64-*" -Directory)[0].FullName
- Invoke-Expression "& $covAnalysisWin64\bin\cov-build.exe --return-emit-failures --dir ..\cov-int msbuild /verbosity:minimal `"/consoleloggerparameters:PerformanceSummary;NoSummary`" /maxcpucount:1 Wireshark.sln"
- cd ..
@ -676,7 +676,7 @@ Clang Static Analyzer:
CC: "clang-${CLANG_VERSION}"
CXX: "clang++-${CLANG_VERSION}"
script:
- scan-build-${CLANG_VERSION} cmake -DCMAKE_BUILD_TYPE=Debug -DENABLE_WERROR=OFF -G Ninja ..
- scan-build-${CLANG_VERSION} cmake -DCMAKE_BUILD_TYPE=Debug -DENABLE_WERROR=OFF -DUSE_qt6=OFF -G Ninja ..
- scan-build-${CLANG_VERSION} -o ../sbout ninja
- cd ../sbout
- RAW_DIR=$( find ../sbout -type d -name "20??-??-??-*" -printf "%P\n" | head )
@ -699,7 +699,7 @@ Visual Studio Code Analysis:
when: always
script:
- $env:caexcludepath = "C:\Qt;$env:INCLUDE"
- cmake -DENABLE_CODE_ANALYSIS=ON -G "Visual Studio 17 2022" -A x64 -DUSE_qt6=ON -DENABLE_LTO=off ..
- cmake -DENABLE_CODE_ANALYSIS=ON -G "Visual Studio 17 2022" -A x64 -DENABLE_LTO=off ..
- msbuild /verbosity:minimal "/consoleloggerparameters:PerformanceSummary;NoSummary" /maxcpucount:2 Wireshark.sln
# Build all doxygen docs

View File

@ -1185,9 +1185,6 @@ ws_find_package(Systemd BUILD_sdjournal HAVE_SYSTEMD)
if(BUILD_wireshark OR BUILD_logray)
if(USE_qt6)
set(qtver "6")
if(DEFINED ENV{WIRESHARK_QT6_PREFIX_PATH})
set(CMAKE_PREFIX_PATH $ENV{WIRESHARK_QT6_PREFIX_PATH})
endif()
else()
set(qtver "5")
# XXX We used to recommend setting QT5_BASE_DIR. Remove after the 4.0 branch is created.
@ -1610,6 +1607,8 @@ add_subdirectory( wsutil )
if(BUILD_wireshark AND QT_FOUND)
add_subdirectory( ui/qt )
elseif(BUILD_wireshark AND USE_qt6)
message(VERBOSE "To use Qt5 instead of Qt6 use CMake option USE_qt6=OFF.")
endif()
if(BUILD_logray AND QT_FOUND)

View File

@ -3,7 +3,7 @@
option(BUILD_wireshark "Build Wireshark" ON)
option(BUILD_logray "Build Logray" OFF)
if(BUILD_wireshark OR BUILD_logray)
if(DEFINED ENV{WIRESHARK_QT6_PREFIX_PATH})
if(NOT DEFINED ENV{WIRESHARK_BUILD_WITH_QT5})
option(USE_qt6 "Use Qt6 instead of Qt5" ON)
else()
option(USE_qt6 "Use Qt6 instead of Qt5" OFF)

View File

@ -18,6 +18,8 @@ It is used for troubleshooting, analysis, development and education.
// Add *major* changes here.
* Wireshark now builds with Qt6 by default. To use Qt5 instead pass USE_qt6=OFF to CMake.
Many other improvements have been made.
See the “New and Updated Features” section below for more details.

View File

@ -306,9 +306,7 @@ Note that installation of separate Qt components are required for 64 bit and 32
The components are forward compatible; you can build Wireshark using Qts “msvc2019 64-bit” and Visual {cpp} 2022.
The environment variable `https://doc.qt.io/qt-5/cmake-get-started.html[CMAKE_PREFIX_PATH]` should be set as appropriate for your environment and should point to the Qt installation directory, e.g. _C:\Qt{backslash}{qt-lts-version}.2\msvc2019_64_
Wireshark has experimental support for Qt 6.
If you would like to build Wireshark with Qt 6 you must install it along with the “Qt5 Compatibility Module” component and and pass `-DUSE_qt6=ON` to cmake.
You can optionally set the `WIRESHARK_QT6_PREFIX_PATH` environment variable to your Qt 6 installation directory instead of `CMAKE_PREFIX_PATH`.
By default Wireshark uses Qt 6. If you would like to build Wireshark with Qt 5 you must pass `-DUSE_qt6=OFF` to cmake.
The Qt maintenance tool (_C:\Qt\MaintenanceTool.exe_) can be used to upgrade Qt to newer versions.

View File

@ -34,7 +34,7 @@ endif
dh $@ --with python3 --buildsystem $(DH_BUILDSYSTEM) --with quilt
override_dh_auto_configure:
dh_auto_configure -- -DBUILD_xxx2deb=ON -DBUILD_corbaidl2wrs=ON
dh_auto_configure -- -DBUILD_xxx2deb=ON -DBUILD_corbaidl2wrs=ON -DUSE_qt6=OFF
override_dh_auto_build:
# Ignore warnings from asn2wrs.py about duplicate field names.

View File

@ -289,7 +289,7 @@ development of Wireshark scripts and plugins.
-DENABLE_CCACHE=ON \
%endif
%if %{with qt5}
-DBUILD_wireshark=ON \
-DBUILD_wireshark=ON -DUSE_qt6=OFF \
%else
-DBUILD_wireshark=OFF \
%endif

View File

@ -82,9 +82,10 @@ BASIC_LIST="base-devel \
ninja \
pcre2 \
python \
qt5-base \
qt5-multimedia \
qt5-tools \
qt6-base \
qt6-multimedia \
qt6-tools \
qt6-5compat \
sbc \
snappy \
spandsp \