summaryrefslogtreecommitdiffstats
path: root/qt_cmdline.cmake
Commit message (Collapse)AuthorAgeFilesLines
* Build system: Allow user to enable Intel CETYuhang Zhao2022-04-061-0/+1
| | | | | | | | | | | | | | | | | MSVC: https://docs.microsoft.com/en-us/cpp/build/reference/guard-enable-eh-continuation-metadata?view=msvc-170 https://docs.microsoft.com/en-us/cpp/build/reference/cetcompat?view=msvc-170 GCC: https://gcc.gnu.org/onlinedocs/gcc-11.2.0/gcc/Instrumentation-Options.html Clang: Don't know where's the documentation but should use the same parameter with GCC. Change-Id: I654618e45743a5ad1394c930932b9d0044572725 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* configure: CMake: Add -no-prefix optionAlexandru Croitor2022-02-241-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce a new -no-prefix option that can be used to build Qt without having to install it. Currently, -no-prefix is already implied by -developer-build, but -developer-build also implies -warnings-are-errors and -feature-private-tests, which not everyone might want to use. Some Qt builders likely use -developer-build for the no-prefix behavior, hence we introduce a standalone -no-prefix option to offer a nicer user experience without -Werror and friends. Previously it was possible to achieve the same by specifying -prefix $PWD, but that relies on $PWD expanding property in the used shell. The new -no-prefix doesn't depend on the type of the shell and is shorter to type. Internally this gets passed by configure as -DINPUT_no_prefix=yes to CMake, and transformed into a -DQT_FEATURE_no_prefix=ON feature. The feature also gets automatically auto-detected to ON if developer-build is set, -prefix is either unset or $PWD. CMake code should still query QT_WILL_INSTALL to decide whether files need to be installed or not. As a drive-by, we now also export QT_FEATURE_developer_build to be available for querying during configuration of other repos (previously it was only possible to query FEATURE_developer_build). Pick-to: 6.2 6.3 Change-Id: Iaa6c8d8ae2b736282e9949d2a5d7f412e290a253 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* CMake: Add support building Qt with the 'mold' linkerAlexandru Croitor2022-01-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | The mold linker is a new linker for Linux that provides faster link times compared to BFD ld, ld.gold and lld. It can be found at https://github.com/rui314/mold To build Qt with mold, ensure that the binary in your PATH and then configure Qt with with either cmake /path/to/qtbase -DINPUT_linker=mold or /path/to/qtbase/configure --linker mold The change was tested with gcc 9, clang 10, clang 12, mold 1.0.0. Only qtbase and qtdeclarative (and dependencies) were tested. Pick-to: 6.2 6.3 Task-number: QTBUG-99270 Change-Id: I2e64a1f4257c37ff5b64a9326e548b9b46e07c80 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* configure: Remove vestiges of handling QMAKE_* variable assignmentsJoerg Bornemann2021-11-241-14/+0
| | | | | | | | | When qmake and CMake build were both available next to each other, we answered QMAKE_FOO=bar assignments in the CMake build with an error message. This code is never triggered these days and can be removed. Change-Id: Ifd29283b8ddc86b94c4e6cbce9e9252215e9f2fe Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Move the 'qmake' feature to src/tools/configure.cmakeJoerg Bornemann2021-11-191-1/+0
| | | | | | | | This allows us to present 'qmake' in the tool-related section of the configure summary. Change-Id: I897dec23cb0608706ec01d9b91283dbce92b293f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add configure feature 'androiddeployqt'Joerg Bornemann2021-11-191-0/+1
| | | | | | | | | | | This makes it possible to turn off the build of the Android deployment tool. A new src/tools/configure.cmake is added that will be the place for all tool-related features in qtbase. Change-Id: Ic9264c93ee96de06c97d21d2f27f73256f48ffda Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* configure: Remove declaration of the DBUS_[HOST_]PATH variablesJoerg Bornemann2021-11-011-2/+0
| | | | | | | | | These variable were used in Qt5 to specify the install location of the DBus library. In Qt6, pkg-config and the usual CMake mechanisms are used. Change-Id: Ic3d61d50c1051200c12bac861dc1fbfe0cb8a4a1 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Remove dysfunctional -coverage configure argumentJoerg Bornemann2021-08-101-1/+0
| | | | | | | | | | | | | | The -coverage argument merely added compiler flags for the Qt build. It was never properly ported to the CMake build, and it doesn't seem feasible to have configure arguments for every possible compiler option. The same can be achieved by passing the needed compiler option to CMake, for example: CMAKE_CXX_FLAGS=-fsanitize-coverage=trace-pc-guard Pick-to: 6.2 Fixes: QTBUG-86227 Change-Id: Ieef9acaedc0a839f9fb35b4403395eea28643864 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Remove unsupported host-related configure optionsJoerg Bornemann2021-07-061-5/+0
| | | | | | | | | | | | | The following host-related configure options were unsupported since Qt 6.0 and are now completely removed: -hostprefix -external-hostbindir -host*dir (except -hostdatadir) -android-ndk-host Pick-to: 6.2 Change-Id: Ib69d90c40ef546f61bf87b1f443eb9d10f7a5a21 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Propagate sanitizer flags to public projectsAlexandru Croitor2021-06-251-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ensure that Qt user projects build with sanitizer flags if Qt was configured with any of the sanitizers enabled. To compile Qt with sanitizer support enable any of Qt sanitizer features. Passing -DECM_ENABLE_SANITIZERS=address to CMake is NOT supported anymore. When configuring Qt using CMake directly, pass -DFEATURE_sanitizer_address=ON -DFEATURE_sanitizer_undefined=ON instead of -DECM_ENABLE_SANITIZERS=address;undefined When configuring Qt with the configure script pass -sanitize address -sanitize undefined as usual. QtConfig.cmake now records the sanitizer options that should be enabled for all consuming projects based on the enabled Qt features. This applies to internal Qt builds as well as well as tests an examples. The recorded sanitizer options are assigned to the ECM_ENABLE_SANITIZERS variable in the directory scope where find_package(Qt6) is called. The ECMEnableSanitizers module is included to add the necessary flags to all targets in that directory scope or its children. This behavior can be opted out by setting the QT_NO_ADD_SANITIZER_OPTIONS variable in projects that use Qt and might be handling sanitizer options differently. Amends 7e03bc39b8bcdaa4e83e72ac99e117561c124951 Pick-to: 6.2 Fixes: QTBUG-87989 Task-number: QTBUG-92083 Change-Id: I2e3371147277bdf8f55a39abaa34478dea4853a6 Reviewed-by: Robert Löhning <robert.loehning@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* CMake: Build minimal subset of tests in desktop static buildsAlexandru Croitor2021-04-061-2/+3
| | | | | | | | | | | | | | | | | | | | | | | Add new configure option -make minimal-static-tests and CMake option QT_BUILD_MINIMAL_STATIC_TESTS. In conjunction with QT_BUILD_TESTS it will enable building a minimal subset of tests when targeting a static desktop Qt build. In qtbase the minimal subset includes all the auto tests of testlib, tools, corelib and cmake. In particular this will also do cmake build tests and qmake build tests (tst_qmake) Adjust CI instructions to enable building a minimal subset of static tests when a platform configuration is tagged with the MinimalStaticTests feature. Fix and skip a few tests that were failing. Pick-to: 6.1 Task-number: QTBUG-87580 Task-number: QTBUG-91869 Change-Id: I1fc311b8d5e743ccf05047fb9a7fdb813a645206 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Add the 'FEATURE_qmake' featureAlexey Edelev2021-03-041-0/+1
| | | | | | | | Add a conditional build of the qmake. Task-number: QTBUG-89369 Change-Id: I8d7968ffb20ea31df2f85fff055e0d131ed06a36 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Update name of c++2a to c++20Kai Köhne2021-02-101-9/+9
| | | | | | | | | | Keep the c++2a feature, but make it an alias for compatibility purposes. Pick-to: 6.1 Change-Id: I6f153109be84659806f1b7a57a88a187875166d8 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* CMake: Add extra targets to run single benchmark using CMake generatorAlexey Edelev2020-12-071-2/+5
| | | | | | | | | | | | | | | | | | Add custom targets with '_benchmark' suffixes to make run of benchmarks using generators possible, e.g.: $ ninja tst_bench_qudpsocket_benchmark Extend '-[no]make' option to pass benchmark. Rework '-[no]make' processing to unify these options processing. Also looks like it doesn't make sense to enable benchmarks without having test enabled. So '-DQT_BUILD_BENCHMARKS' enables test as own dependency automatically. Task-number: QTBUG-89076 Pick-to: 6.0 Change-Id: Ieee9eadaf6d75a1efec120242d6eb786ace1b071 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Fixup outdated configure.cmake filesAlexandru Croitor2020-11-101-2/+0
| | | | | | | | Some outdated changes don't get removed when using special case preservation, so remove them manually. Change-Id: Iba1481ab9a924c3031bd5ce394d5183a5393f146 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Fix the -sanitize configure optionJoerg Bornemann2020-10-121-0/+1
| | | | | | | | This needs to map to ECM_ENABLE_SANITIZERS. Fixes: QTBUG-87316 Change-Id: I9e983728af0ba69fd428944e647f0afae8c61772 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Regenerate configure.cmake filesAlexandru Croitor2020-09-281-0/+2
| | | | | Change-Id: I165c633d7c052fb80419d4b2c57561de40217ade Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: build add flags for building QtAndroid.jarAssam Boudjelthia2020-09-161-0/+2
| | | | | | | | | | | | | Adds -source, -target, -Xlint:unchecked, -bootclasspath flags. Setting default javac build source and target versions to 8. Allow setting custom values for javac build versions via -DQT_ANDROID_JAVAC_SOURCE, and -DQT_ANDROID_JAVAC_TARGET. Task-number: QTBUG-86282 Change-Id: I98f4f193ac96016dc722d178594d7fd401202f68 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Remove the -no-compile-examples configure switchJoerg Bornemann2020-09-111-1/+0
| | | | | | | | | | | | If '-make examples -no-compile-examples' was specified, sources of Qt's examples would be installed, but the examples would not be built. This switch has always been a source for confusion and is only interesting for distributors, who can just package the examples directory tree. Change-Id: I0291d70e4951d98b553a4abf217db49d05316d3a Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* CMake: Re-implement configure/qmake's command line handling in CMakeJoerg Bornemann2020-08-171-0/+192
We extend configurejson2cmake to read the "commandline" information from configure.json. This data is then translated to CMake function calls and written it into commandline.cmake files. We extend QtProcessConfigureArgs.cmake to pick up those commandline.cmake files to feed our command line handling code, which is a re-implementation of the command line handling in qt_configure.prf. The command line handler sets INPUT_xxx variables, similar to configure/qmake's config.input.xxx variables. The INPUT_xxx values are translated - to -DFEATURE_xxx=ON/OFF arguments if the input represents a feature, - to corresponding CMake variables if such a variable is known, - or to -DINPUT_xxx=yyy CMake arguments. Configure arguments that have an entry in cmake/configure-cmake-mapping.md are actually implemented. Other arguments are likely to need more work. Task-number: QTBUG-85373 Change-Id: Ia96baa673fc1fb88e73ba05a1afb473aa074b37d Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>