summaryrefslogtreecommitdiffstats
path: root/configure.cmake
Commit message (Collapse)AuthorAgeFilesLines
* zlib as static libraryKai Köhne2022-04-221-3/+2
| | | | | | | | | | Do build zlib as static 3rdparty library. This makes it easier to disable warnings. Pick-to: 6.3 Change-Id: I1db331b671b64e68d81c56b0df337983c3bbe7fa Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Fix no_prefix feature to take into account the staging prefixAlexandru Croitor2022-04-191-5/+2
| | | | | | | | | | | | | | | | | | | | | Instead of complicating the condition even more, just use the value of QT_WILL_INSTALL which is determined in QtSetup before configure.cmake is loaded. The AUTODETECT part is needed to ensure that -developer-build implies -no-prefix. The CONDITION part is needed so that -extprefix /tmp/sysroot -no-prefix correctly errors out saying that this can't be a non-prefix build, unless -extprefix ${qtbase_build_dir} -no-prefix is passed. Pick-to: 6.2 6.3 Change-Id: Ie4f5a91281bf2fbe1bd0744de05d57f43fe992e7 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* CMake: Add rudimentary c++2b featureJoerg Bornemann2022-04-141-0/+5
| | | | | | | | | | | | | This fixes the "Could not find feature c++2b." error when building a Qt module with qmake. The feature is OFF by default for now. This amends commit b5ed3cb7baeb6d77c375134719ee04ffcc211b9f. Pick-to: 6.2 6.3 Change-Id: Ibabe3ce29275699e66ab1f32d19d583d6bcede9e Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Build system: Allow user to enable Intel CETYuhang Zhao2022-04-061-1/+2
| | | | | | | | | | | | | | | | | 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>
* Enable -mno-direct-extern-access and ELF protected visibilityThiago Macieira2022-03-101-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The -mno-direct-extern-access tells the compiler and linker that references to symbols outside this ELF module mustn't be direct and must instead always go through the GOT or PLT (the PLT can additionally be disabled with -fno-plt). The ELF protected visibility tells the compiler and linker that this symbol is present in the dynamic symbol table as an export, but it cannot be interposed by another ELF module. This option is required for user code to link properly to Qt, otherwise they will get linker errors (assuming GNU binutils >= 2.39) or runtime failures (glibc >= 2.35). Both versions of glibc and binutils are older than GCC 12, so it's a safe assumption they are in use and downgrading the toolchain or libc is not supported. Adding this option to the compilation is assured for CMake and qmake-based projects. For example, all accessess to QCoreApplication::self in QtCore, after this change and with GCC 12 are relocation-free and direct: 000000000013ebf0 <QCoreApplicationPrivate::checkInstance(char const*)>: 13ebf0: cmpq $0x0,0x4f73d0(%rip) # 635fc8 <QCoreApplication::self> 13ebf8: setne %al 13ebfb: je a90fe <QCoreApplicationPrivate::checkInstance(char const*) [clone .cold]> 13ec01: ret Meanwhile, accesses to the same variable in other modules are indirect via the GOT: 66650: mov 0x876e1(%rip),%rax # edd38 <QCoreApplication::self@Qt_6> 66657: cmpq $0x0,(%rax) This replaces the -Bsymbolic and -Bsymbolic-functions (broken) functionality that Qt has been using or attempting to use since ~2006. See https://gitlab.com/x86-psABIs/x86-64-ABI/-/issues/8#note_606975128 Change-Id: Iad4b0a3e5c06570b9f5f571b26ed564aa0811e47 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* CMake: add detection of x86 VAES and AVX512VBMI2 featuresThiago Macieira2022-03-081-2/+20
| | | | | | | | We have VAES code in qhash.cpp that isn't getting compiled right now. Change-Id: Ibf4acec0f166495998f7fffd16d6961261dec361 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* CMake: Rename FindZSTD to FindWrapZSTDAlexandru Croitor2022-02-281-2/+2
| | | | | | | | | | | | And the target ZSTD::ZSTD to WrapZSTD::WrapZSTD. This should allow building Qt with the -DCMAKE_FIND_PACKAGE_PREFER_CONFIG=ON set. Pick-to: 6.2 6.3 Fixes: QTBUG-100537 Change-Id: I748601e4ad6f518323bf1034d6fc1de582c815e1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* configure: CMake: Add -no-prefix optionAlexandru Croitor2022-02-241-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* qsimd: Remove QT_COMPILER_SUPPORTS_SIMD_ALWAYSThiago Macieira2022-02-181-10/+0
| | | | | | | | | | | | All[*] compilers support it, always. The last to not support it was GCC 4.8, which we don't support in Qt 6. [*] Anecdotally, clang-cl doesn't but clang-cl isn't supported and that would be an upstream problem: clang-cl developers must find a solution that either matches Clang or cl.exe. Change-Id: I54f205f6b7314351b078fffd16d0a5ed5b7afae5 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* GHS compiler doesn't support signaling NaNs for doubleTatiana Borisova2022-02-091-1/+5
| | | | | | | | | | - has_signaling_NaN returns TRUE by mistake, will be fixed in future compiler releases. Task-number: QTBUG-99123 Pick-to: 6.2 6.3 Change-Id: I3f2af7b5328b49d7ceffa548461d1d6bf72ba7ed Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* configure: Tie -appstore-compliant to QT_APPLE_NO_PRIVATE_APISTor Arne Vestbø2022-02-021-0/+3
| | | | | | Pick-to: 6.3 6.2 Change-Id: Ieb0f7398498483d5b48a16623dfc28bb6fb55f0b Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Add support building Qt with the 'mold' linkerAlexandru Croitor2022-01-201-1/+29
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* CMake: Fix detection of linker availabilityAlexandru Croitor2022-01-181-3/+3
| | | | | | | | | | | | | | | | | | | | Previously we passed flags like -ld-fuse=lld only to compile calls, but not to the link call of a compile test project. Make sure to pass it to the link call instead by using check_cxx_source_compiles + CMAKE_REQUIRED_LINK_OPTIONS instead of check_cxx_compiler_flag. Note the flag that is passed is still via passed via the compiler launcher and not directly to the linker. Remove duplicate flag handling code. Pick-to: 6.2 6.3 Change-Id: I1bf90573904a9df83240b6debfee3cc9e425c6bb Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Support configure -platform linux-clang-libc++Allan Sandfeld Jensen2021-12-141-0/+5
| | | | | | | | Detect libc++ config and add appropriate compiler and linker flags. Pick-to: 6.3 Change-Id: I9ec91b3ace987599d4e79e43b1b75aa67cd5caeb Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* wasm: add simd supportLorn Potter2021-10-051-2/+4
| | | | | | | | | | | | | | | | | | Emscripten only supports SSE1, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, and 128-bit AVX instruction sets at this time. https://emscripten.org/docs/porting/simd.html Browsers might need to enable simd support in the advanced configurations about: config or chrome:flags Enable by configuring Qt with -sse2 Pick-to: 6.2 Fixes: QTBUG-63924 Change-Id: Ifeafae20e199dee0d19689802ad20fd0bd424ca7 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Add Qt PrintSupport to the configure summaryJoerg Bornemann2021-09-031-0/+1
| | | | | | | | | | Whether Qt is built with PrintSupport is now listed under "Qt modules and options" in the configure summary. Pick-to: 6.2 Task-number: QTBUG-88535 Change-Id: Id367c9594482b0764da679c3cbdee2f5108201ef Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix Android -ltcg buildJoerg Bornemann2021-08-201-0/+6
| | | | | | | | | | | | | | We're passing -Oz for release builds, but that's not a flag the linker understands when -ltcg is enabled. The build fails with: ld.gold: fatal error: Optimization level must be between 0 and 3 Fix this by using -O2, which -Oz is based on, and -O3 for the "full optimization" that is used for core and gui. Pick-to: 6.2 Fixes: QTBUG-89472 Change-Id: Ie1a86888baefce5ca97026e7d635f10d2819f9f4 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Remove dysfunctional -coverage configure argumentJoerg Bornemann2021-08-101-26/+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>
* Don't repeat conditions of use_*_linker features in QtFeature.cmakeJoerg Bornemann2021-07-131-46/+59
| | | | | | | | | | | | | | qt_config_linker_supports() repeated the conditions of all use_*_linker features, because the features are not evaluated yet when this function is called, and the function needs to know what linker is used to build Qt. Move the required tests and features before any qt_config_linker_supports() call and evaluate the use_*_linker features early. Change-Id: I306f032356682a0e82e4d7c4234e5bbc820ab143 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* The build for INTEGRITY is static only so libdl.a is not neededTatiana Borisova2021-07-061-2/+2
| | | | | | Pick-to: 6.2 Change-Id: I8e81d00a0be2521e42db98d3b687b8e1471753e9 Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
* Fix the precompile_header configure testJoerg Bornemann2021-06-191-13/+2
| | | | | | | | This configure test always failed, and its result was never used. Pick-to: 6.2 Change-Id: I5112464b247efb5327ef5c23c96ef27168c11afc Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Expose the "debug" build feature privatelyJoerg Bornemann2021-06-161-2/+1
| | | | | | | | | | Consumers can now check the "debug" feature to determine whether Qt was built in the "Debug" configuration. Pick-to: 6.2 6.1 Change-Id: I225125d38ded508e9792a730ce421b33bceacddf Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* wasm: fix up compiler messageLorn Potter2021-06-081-1/+1
| | | | | | | It's Emscripten compiler, not wasm compiler. Change-Id: I39e754be9486500d9bba71006642fbdb1261c84c Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Add runtime ARM64 AES checkAllan Sandfeld Jensen2021-05-201-8/+22
| | | | | | | | | | | | Adds runtime CPU detection for Windows and macOS, and switches feature detection of AES to runtime like for x86, So far only on ARM64, since gcc doesn't do function versioning on ARM32, but clang can, so it could be added later. Change-Id: Ibe5d60f48cdae3e366a8ecd6263534ba2b09b131 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix wrong note "Using pthreads" and only show it for WASMLi Xinwei2021-04-291-2/+2
| | | | | | | | | | | | | | MSVC does not have pthreads. "QT_FEATURE_thread" should mean "Enable thread support". And I think this note is only meaningful for WASM. For other platforms, thread support should be enabled by default. amends 4972fdb350fe79e18b0413e74028cd9b9803f96b Change-Id: I5a4fc05219c9b2ff9c6e54fd444b4b94230727bb Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Regenerate configure.cmake filesAlexandru Croitor2021-04-271-1/+1
| | | | | | | | | And adjust configure.json files that were stale Amends d385158d5213ef568b7629e2aa4a818016bbffac Change-Id: I851838a12c3773a6e8119ebc7f1de941ae7fe224 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Add Solaris support in cmake buildNiclas Rosenvik2021-04-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add SOLARIS cmake platform definition. Add settings for QT_DEFAULT_MKSPEC so that qplatformdefs.h can be found. Solaris has its gssapi symbols in libgss. Solaris supports @ORIGIN. Solaris ld does not support --dynamic-list needed for reduce relocations. Make solaris fail the reduce relocation test. getauxval is specific to GNU libc and some other libc implementations on Linux but sys/auxv.h is not. The bootstrap uses sys/aux.h as the only indication for getauxval. This breaks builds on Solaris, so only make sys/auxv.h an indicator for getauxval on linux or glibc based systems. Solaris uses X11 so add it to the X11_SUPPORTED list. Solaris network libraries for sockets etc are in socket and nsl. ifreq does not have a member ifr_ifindex on Solaris, it uses ifr_index. Add test to check if ifr_index is a member of ifreq. The first struct in the in_addr union on solaris is defined as four uint8_t, therefore four arguments are needed for its initializer list. Change-Id: Ieed4c1bbac8559a7ae1db9c4e1e91f609f150270 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Introduce zlib find script to work around hardcoded iOS SDKAlexandru Croitor2021-04-191-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Xcode allows building a project targeting either the device or simulator sysroot in one single build dir, but for the sysroot switching to work there should be no linker or compiler flags referencing absolute paths of a specific sysroot. During CMake configuration of a project targeting iOS, all found system libraries will be within one single sysroot, either the device one or the simulator one, whichever one was passed to CMAKE_OSX_SYSROOT. CMake will then generate the Xcode project and pass those absolute paths, which makes sysroot switching within Xcode not work. To avoid that, the CMake documentation recommends passing linker and framework flags of the form '-lfoo' and '-framework bar' instead of absolute paths. Xcode then takes care of setting the correct framework search path. Zlib is one of the libraries found in the iOS sysroot and thus passed as absolute path. To avoid that, create a new FindWrapZLIB find script. The target it creates will pass the absolute path to the library on non Apple platforms and an -lz linker flag on Apple platforms (macOS and iOS). To avoid issues with target global promotion when system PNG package is found, ensure that a found ZLIB::ZLIB target is promoted to global manually in src/gui/configure.cmake. Pick-to: 6.1 Change-Id: I8bd8649be4f680a331ad51925f27cb9d13ac5e5f Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Check whether CMake was built with zstd supportJoerg Bornemann2021-04-161-0/+18
| | | | | | | | | | | | | | | | CMake 3.18 introduced the file(ARCHIVE_CREATE) API that we use with COMPRESSION Zstd for compressing corelib's mimedatabase. It's possible to build CMake without proper zstd support, and we have encountered such builds in the wild where the file(ARCHIVE_CREATE) call crashes. Add a configure test to determine whether CMake properly supports the Zstd compression method. Fixes: QTBUG-89108 Change-Id: I37e389c878845162b6f18457984d4f73a265b604 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* "Export" linker featuresMichal Klocek2021-04-071-0/+3
| | | | | | | We need to feed gn with linker info for qtwebengine build. Change-Id: I4bd96af8bb8a1927e4c03e5c5d4ade10a0876eb1 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Fix building multi-arch universal macOS QtAlexandru Croitor2021-04-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the same approach we use for iOS, which is to set multiple CMAKE_OSX_ARCHITECTURES values and let the clang front end deal with lipo-ing the final libraries. For now, Qt can be configured to build universal macOS libraries by passing 2 architectures to CMake, either via: -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" or -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" Currently we recommend specifying the intel x86_64 arch as the first one, to get an intel slice configuration that is comparable to a non-universal intel build. Specifying the arm64 slice first could pessimize optimizations and reduce the feature set for the intel slice due to the limitation that we run configure tests only once. The first specified architecture is the one used to do all the configure tests. It 'mostly' defines the common feature set of both architecture slices, with the excepion of some special handling for sse2 and neon instructions. In the future we might want to run at least the Qt architecture config test for all specified architectures, so that we can extract all the supported sub-arches and instruction sets in a reliable way. For now, we use the same sse2 hack as for iOS simulator_and_device builds, otherwise QtGui fails to link due to missing qt_memfill32_sse2 and other symbols. The hack is somewhat augmented to ensure that reconfiguration still succeeds (same issue happened with iOS). Previously the sse2 feature condition was broken due to force setting the feature to be ON. Now the condition also checks for a special QT_FORCE_FEATURE_sse2 variable which we set internally. Note that we shouldn't build for arm64e, because the binaries get killed when running on AS with the following message: kernel: exec_mach_imgact: not running binary built against preview arm64e ABI. Aslo, by default, we disable the arm64 slice for qt sql plugins, mostly because the CI provisioned sql libraries that we depend on only contain x86_64 slices, and trying to build the sql plugins for both slices will fail with linker errors. This behavior can be disabled for all targets marked by qt_internal_force_macos_intel_arch, by setting the QT_FORCE_MACOS_ALL_ARCHES CMake option to ON. To disble it per-target one can set QT_FORCE_MACOS_ALL_ARCHES_${target} to ON. Task-number: QTBUG-85447 Change-Id: Iccb5dfcc1a21a8a8292bd3817df0ea46c3445f75 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* wasm: add cmake build supportLorn Potter2021-04-011-4/+19
| | | | | | | | | | | | | | | | A few configure defines get changed: QMAKE_WASM_PTHREAD_POOL_SIZE is now QT_WASM_PTHREAD_POOL_SIZE QMAKE_WASM_TOTAL_MEMORY is now QT_WASM_INITIAL_MEMORY QMAKE_WASM_SOURCE_MAP_BASE is now QT_WASM_SOURCE_MAP_BASE device-option EMSCRIPTEN_ASYNCIFY=1 is QT_EMSCRIPTEN_ASYNCIFY=1 To create source maps for debugging. use device-option QT_WASM_SOURCE_MAP=1 Task-number: QTBUG-78647 Change-Id: If9f30cd7fb408c386d6d69b5f7b1beecf1ab44b5 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Expose sub-arch test results as featuresAlexandru Croitor2021-03-311-22/+22
| | | | | | | | | Needed for QT_FEATURE_foo checks in repos other than qtbase when building SIMD specific files (e.g. qtimageformats). Task-number: QTBUG-85447 Change-Id: Ibd2200fe24cecbb0b2a092f645ca622baf738601 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Error out on attempt to configure framework build with lib infixJoerg Bornemann2021-03-171-2/+7
| | | | | | | | | | | | | | Setting a lib infix is not supported with framework builds due to the nature framework of include resolution: includes like <QtCore/qstring.h> won't work if the framework is named QtCoreInfix. The combination framework build and lib infix was agreed on to be out of scope in the comments of QTBUG-35604. Pick-to: 6.1 Change-Id: Ib7c6983f2f64ea1a7cfcd56657d31eeab3f55fe3 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Use newlines more consistently in generate compile-test codeEdward Welbourne2021-02-151-26/+8
| | | | | | | | | | | The generated code contained many repeated blank lines. Most main()s were preceded by one, but not all. Only include blank lines for actual empty entries in lists, where configure.json specified them, plus one before main if anything else precedes it. Change-Id: I6e6c34940e08712a1aa848a3c9ad1b0fb5806d77 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Simplify test-snippets in configure.cmakeEdward Welbourne2021-02-151-24/+12
| | | | | | | | | The main(void) signature obviates the need for unused parameters and has existed since (at least) C89; so use that instead of the old-fashioned argc/argv arguments we don't use in any of these tests. Change-Id: Ibfe850a1fce378673c9781011475ea623fd75ad4 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Add some special case markers that seem to have been neglectedEdward Welbourne2021-02-151-0/+2
| | | | | | | | At least, running util/cmake/configurejson2cmake.py changes these lines. Adding them has provoked the script to add a .prev_configure.cmake file. Change-Id: Idc123d1dee2ce51cd640c090c7910ecc1f0fc5a4 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Update name of c++2a to c++20Kai Köhne2021-02-101-8/+13
| | | | | | | | | | 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>
* Make it possible to disable the PrintSupport moduleJoerg Bornemann2021-02-091-0/+4
| | | | | | | | | | | | | | Introduce the 'printsupport' feature to control whether the PrintSupport module is built. [ChangeLog][QtPrintSupport] Building of QtPrintSupport can be disabled by passing -no-feature-printsupport to configure. Fixes: QTBUG-90778 Change-Id: I8a9a4b7f8dd8f39a81565c8eb14ce1ae0839267d Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Nodir Temirkhodjaev <nodir.temir@gmail.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* CMake: Add --enable-new-dtags flag supportAlexey Edelev2020-12-221-0/+5
| | | | | | | | | | | | | Remove enable-new-dtags from feature mapping, handle it as regular feature. Regenerate configure.cmake with 'enable-new-dtags' enabled. Check for enable_new_dtags feature, add -Wl,--enable-new-dtags if enabled. Fixes: QTBUG-89013 Pick-to: 6.0 Change-Id: Ice57c02dc85f7f9ecf14e3bc65f31a57b589ce24 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Craig Scott <craig.scott@qt.io>
* CMake: Fix conditions for some subarch featuresAlexandru Croitor2020-12-041-3/+3
| | | | | | | | | | The AES and SHA features were checking for the wrong TEST_subarch_foo variables. Pick-to: 6.0 Task-number: QTBUG-87376 Change-Id: I46cd14d98832529aebac22cfcb01180330c5e091 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Fix detection of the ltcg featureJoerg Bornemann2020-11-061-2/+3
| | | | | | | | | | | | | | | When checking the value of CMAKE_INTERPROCEDURAL_OPTIMIZATION_<CONFIG>, then <CONFIG> must be the upper case configuration name. Also, we must not unset __qt_ltcg_detected, because the feature condition evaluation happens way after the feature definition, and __qt_ltcg_detected was not available anymore there. This commit amends 96bdcdacbc0. Fixes: QTBUG-87874 Change-Id: I2b555bd1d7fbc8973e1d9493045c27d61b0d2c1b Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Allow Debug-only iOS buildsJoerg Bornemann2020-10-161-5/+7
| | | | | | | | | They are disabled for the qmake build due to QTBUG-71990, but the issue doesn't apply to the CMake build. Task-number: QTBUG-71990 Change-Id: I6c659e9dbbc947fd3c6241f9fab2ea306c98020b Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Allow embedding debug info in object files with MSVCAlexandru Croitor2020-10-061-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce a new feature called 'FEATURE_msvc_obj_debug_info' which should allow usage of sccache for Windows MSVC configs. Enabling the feature will replace the default '/Zi' compile flag that CMake sets in Windows-MSVC.cmake with '/Z7'. This ensures that the debug info is placed into the compiled object file instead of placing it in the compilation .pdb file via mspdbsrv.exe. The final pdb file will still be created for shared libraries and executables due to the linker '/debug' flag. Static libraries will not have a .pdb file, instead the debug info being embeeded in the .lib file. The downsides of using '/Z7' are more disk space usage, slower link times, more memory used for linking because the linker needs to deal with more symbols. The upside is that caching each indepedent cl.exe call is possible. This is what Chromium uses with goma, and Firefox with sccache. We're not enabling the feature by default to allow easier testing (and switching it off) in the CI if it proves not to be feasible. It will probably have to be disabled at least for building qtwebengine due to high memory requirements. Task-number: QTQAINFRA-3934 Change-Id: I89e0e57995e938a780be318d1faec700194aa93f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Introduce CMake-only optimize_full featureAlexandru Croitor2020-10-061-0/+10
| | | | | | | | | Enabling it will force usage of '-O3' flag when building Qt. If the platform has no '-O3' flag, use '-O2' as a fallback. Task-number: QTBUG-86866 Change-Id: If13f7de954ba5c01dc9634f06a85529828fe90a9 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Implement configure -reduce-exportsJoerg Bornemann2020-10-051-1/+1
| | | | | | | | | | | | | | | | | This option maps to FEATURE_reduce_exports. The feature is on by default, except for MSVC. The reduce_exports configure test is not used in the CMake build. The <LANG>_VISIBILITY_PRESET and VISIBILITY_INLINES_HIDDEN target properties are now explicitly initialized in the qt_set_common_target_properties function, because we don't have access to the feature in QtSetup.cmake where the CMAKE_<LANG>_VISIBILITY_PRESET variables were set before. Task-number: QTBUG-85373 Change-Id: I378453f0e0665731970016170302871e20ceb4e2 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* By default don't try to use pkg-config when targeting AndroidAlexandru Croitor2020-09-281-1/+1
| | | | | | | | | | It causes issues in our Windows CI, because the strawberry perl pkg-config is found. And even that one is unusable, due to a bug in CMake which is tracked at https://gitlab.kitware.com/cmake/cmake/-/issues/21239 Change-Id: I58816195d35459e8a44c923399c35a4956c222a2 Reviewed-by: Simon Hausmann <hausmann@gmail.com>
* CMake: Regenerate configure.cmake filesAlexandru Croitor2020-09-151-2/+2
| | | | | | Change-Id: I844e82b4655cf1967b16a7785b4e1ef777e61c22 Reviewed-by: Simon Hausmann <hausmann@gmail.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* CMake: Implement configure -ltcgJoerg Bornemann2020-09-111-2/+14
| | | | | | | | | | | | | | | | | | | This configure switch sets the CMake variable CMAKE_INTERPROCEDURAL_OPTIMIZATION_<CONFIG> per release config to ON. The feature 'ltcg' is enabled if any of the variables CMAKE_INTERPROCEDURAL_OPTIMIZATION, CMAKE_INTERPROCEDURAL_OPTIMIZATION_<CONFIG> are ON. In order to implement the check, configurejson2cmake had to be extended to be able to write extra CMake code before and after the feature definition. This extra code can be added to a feature mapping below the keys "cmakePrelude" and "cmakeEpilogue". Task-number: QTBUG-85373 Change-Id: Ia2eb907edcf087f137977a9b090705397f83eb05 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Remove the -no-compile-examples configure switchJoerg Bornemann2020-09-111-5/+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>