summaryrefslogtreecommitdiffstats
path: root/cmake/QtInternalTargets.cmake
Commit message (Collapse)AuthorAgeFilesLines
* CMake: Fix typosKai Köhne2022-06-131-1/+1
| | | | | | | | | Found by codespell Change-Id: I4907e423b6b345acf82f2d7e0ed62479719d694e Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 04cc705947a4f8e96f98f228a505774293c97840) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Avoid some new clang 14 warnings on Android NDK 24 buildVille Voutilainen2022-05-271-0/+5
| | | | | | | Task-number: QTBUG-99663 Change-Id: I1aa408ba468342e2fac2323ae91ff650b871c563 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Build system: Allow user to enable Intel CETYuhang Zhao2022-04-061-0/+15
| | | | | | | | | | | | | | | | | 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>
* Bootstrap: Make compiler warnings fatalKai Köhne2022-03-021-5/+6
| | | | | | | | | Prevent compiler warnings from creeping into the bootstrap library. Pick-to: 6.3 Change-Id: I8054416564c91fee256cad616911dd4ad231d0df Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Add qt_internal_undefine_global_definition functionAlexey Edelev2022-02-021-9/+2
| | | | | | | | | | | | | | | | qt_internal_undefine_global_definition disables an internal global definition that is defined by the qt_internal_add_global_definition function for a specific target. Remove the ability to set the custom "undefine" flag for the definitions since it's hard to control it using the introduced function. Pick-to: 6.2 6.3 Task-number: QTBUG-100334 Change-Id: Ic1637d97aa51bbdd06c5b191c57a941aa208d4dc Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Restore missing Qt definitionsAlexey Edelev2022-01-311-0/+59
| | | | | | | | | | | | | | | | | Restore the 'QT_NO_JAVA_STYLE_ITERATORS' and 'QT_NO_NARROWING_CONVERSIONS_IN_CONNECT' definitions for Qt targets. Add the function that adds global definitions for Qt targets according to the provided scope and the target property-based switch to disable the definition for a specific target. Pick-to: 6.2 6.3 Task-number: QTBUG-100295 Change-Id: I28697e81f9aabc45c48d79aae1e5caea141e04e1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Fix detection of linker availabilityAlexandru Croitor2022-01-181-6/+4
| | | | | | | | | | | | | | | | | | | | 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>
* Clang: don't error out on -Wdeprecated-enum-enum-conversionMarc Mutz2022-01-181-0/+6
| | | | | | | | Same treatment as is given to GCC further below. Pick-to: 6.3 6.2 Change-Id: I3762c39a0b5d9add365ecf828b80d3ba432578c2 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Enable -bigobj by default for QtAlexey Edelev2022-01-071-1/+8
| | | | | | | | | Add '-bigobj' for MSVC and '-Wa,-mbig-obj' for MINGW to the PlatformCommonInternal compiler options. Pick-to: 6.3 Change-Id: I706b83d189a116a3ab6f93d59593e237e66b0e2e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* MSVC: Optimize global data to reduce binary sizeYuhang Zhao2021-12-151-1/+1
| | | | | | | | | | | | | | | | | | | | Package global data in COMDAT sections for optimization. According to the docs, this can significantly reduce the size of the resulting binary executable. I've tested build Qt with /Gw locally with and without LTCG, the result shows /Gw can reduce the binary size indeed, but not "significantly". The result also reveals that exes can benefit much more from /Gw than dlls. The result can be seen from the QTBUG-98894 bug report. Microsoft Docs: https://docs.microsoft.com/en-us/cpp/build/reference/gw-optimize-global-data?view=msvc-170 Task-number: QTBUG-98894 Change-Id: Ibce34c98e791e519d669a5fe39c0027d1459c382 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Enable warnings-are-errors for Visual Studio 2022Kai Köhne2021-11-301-2/+2
| | | | | Change-Id: Id0b143f668f69481f6037f94aedbfd2e87331497 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Win32: Enable large address aware explicitlyYuhang Zhao2021-11-261-1/+1
| | | | | | | | | | | | | | | | | Large address aware is enabled by default in 64-bit compilers, but not 32-bit compilers. But Qt users may build 32-bit Qt themself, in this case large address aware is disabled in fact, and it may cause some issues. So we pass /LARGEADDRESSAWARE to the linker unconditionally to make sure large address aware is enabled for both 32-bit and 64-bit builds. Microsoft Docs: https://docs.microsoft.com/en-us/cpp/build/reference/largeaddressaware-handle-large-addresses?view=msvc-170 Change-Id: Idb2603d9ba0ba9ef4477ce1c3174b7c7e8ba76f6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* QList: deprecate iterator<->pointer implicit conversions (2/3)Giuseppe D'Angelo2021-10-161-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The constructor from a raw pointer should be 1) constexpr, 2) explicit, and 3) *private*. We can do 1) without too much trouble. 2) is a (easy to fix) SIC in case of implicit conversions accidentally relied upon from somewhere. 3) cannot be "easily" fixed by user code (they have to refactor), and also, it's a BIC on Windows which encodes class members' access in symbols. Someone may have been exporting some QList subclass, in turn exporting the iterator classes, and therefore that someone now has the constructors' symbols with a given access. So, don't do 2+3 _just yet_ for user code, but set a deadline: Qt 6.5 is the last that will support this. On Qt 6.6, we switch. All of this on non-Windows, againt to avoid an ABI break. One can opt-in at any time via a suitable define. Given we have this define, use it to guard the other way around as well: conversions from an iterator to a raw pointer should never be explicit (there's std::to_address for this). [ChangeLog][QtCore][QList] Converting a QList's iterator from and to a raw pointer is deprecated, and will get removed in Qt 6.6. User code can prepare for the change by defining QT_STRICT_QLIST_ITERATORS. Change-Id: I0f34bfa3ac055c02af5a3ca159180304660dfc11 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* CMake: remove support for building Qt with the old Intel compilerThiago Macieira2021-10-131-14/+0
| | | | | | | | | | | | | | | | | | This hasn't worked for some time. It's not in our CI and I don't think it was working at all. When I tried to build it, I ran into several problems with C++17 and an Internal Compiler Error I did not have any interest in working around. After discussing with the Intel compiler team, it was decided that fixing those issues in the old compiler is not going to happen. Instead, their recommendation is to adopt the new LLVM-based compiler, which the last commit added support for. This commit does not remove qmake support for the old ICC. It's possible someone is using qmake with a non-Qt6 project and ICC. Change-Id: Icb2516126f674e7b8bb3fffd16ad6350ddbd49e5 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: add support for Intel's LLVM-based compilerThiago Macieira2021-10-131-20/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This includes a few cleanups to our .cmake files where it was easier to combine existing sections of Clang / AppleClang that no longer needed to be distinct. icpx could be replaced with a shell script: exec `basename $0`/clang++ --intel "$@" tst_qnumeric is not passing FAIL! : tst_QNumeric::classifyF() Compared values are not the same Actual (qFpClassify(tiny / two)): 2 Expected (FP_SUBNORMAL) : 3 Loc: [/home/tjmaciei/src/qt/qt6-icx/qtbase/tests/auto/corelib/global/qnumeric/tst_qnumeric.cpp(344)] FAIL! : tst_QNumeric::classifyD() Compared values are not the same Actual (qFpClassify(tiny / two)): 2 Expected (FP_SUBNORMAL) : 3 Loc: [/home/tjmaciei/src/qt/qt6-icx/qtbase/tests/auto/corelib/global/qnumeric/tst_qnumeric.cpp(344)] FAIL! : tst_QNumeric::floatDistance(denormal) Compared values are not the same Actual (qFloatDistance(from, stop)): 0 Expected (expectedDistance) : 4194304 Loc: [/home/tjmaciei/src/qt/qt6-icx/qtbase/tests/auto/corelib/global/qnumeric/tst_qnumeric.cpp(408)] FAIL! : tst_QNumeric::doubleDistance(denormal) Compared values are not the same Actual (qFloatDistance(from, stop)): 0 Expected (expectedDistance) : 2251799813685248 Loc: [/home/tjmaciei/src/qt/qt6-icx/qtbase/tests/auto/corelib/global/qnumeric/tst_qnumeric.cpp(408)] P Change-Id: Icb2516126f674e7b8bb3fffd16ad59431e8c3379 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Re-enable QT_NO_NARROWING_CONVERSIONS_IN_CONNECT for QtGiuseppe D'Angelo2021-10-131-0/+1
| | | | | | | | | | This define used to be set for the entirety of the Qt build but was lost during the qmake->CMake transition. Re-enable it. Change-Id: Idc4cb6ada485158559485b60f62f76439550b255 Pick-to: 6.2 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* wasm: add simd supportLorn Potter2021-10-051-0/+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>
* Don't force lld for Android when clang is usedJoerg Bornemann2021-08-201-9/+0
| | | | | | | | | | | | | This reverts commit 64c111e10fcb2f69855432177d76649b6b789fac. The claim of the commit message, that we cannot use the gold linker, does not seem to be true (anymore?). This is underlined by the fact that CMake *forces* the gold linker for Android, whenever LTCG is enabled (see Modules/Compiler/Clang.cmake as of CMake 3.21.1). Change-Id: I90edac8555be4abdd44cd367228aeffb0d66b895 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* CMake: Don't propagate -fapplication-extension to user projectsAlexandru Croitor2021-07-161-2/+16
| | | | | | | | | | | | | | | | | | | | | | | | Both the compiler and linker -fapplication-extension flag should only be applied when building Qt's libraries (not executables). It's up to the user project whether their code will be restricted with application-extension-only APIs. In qmake that can be achieved by adding to the qmake project CONFIG += app_extension_api_only In CMake it can be achieved by either adding the compiler and link flags in the project directly (using target_X_options) or by setting the appropriate setting in the Xcode project when using the Xcode generator. Amends e189126f1ae1d2fa2ad0f95ee2c4aa72c770a97b Pick-to: 6.2 Task-number: QTBUG-95199 Change-Id: Ie7a764d460a89c7650391abff0fcc5abfcabef64 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Fix bitcode linker flags not to be added on iOSAlexandru Croitor2021-07-161-1/+0
| | | | | | | | | | | | | | | | | | | We shouldn't force add the bitcode linker flags to user projects. And we don't link anything when building Qt for iOS itself, we only archive object files into static libraries. The final decision whether bitcode should be used is up to the Xcode project. That is controlled by Xcode's ENABLE_BITCODE option. Bitcode compile flags are still added when building Qt itself. Amends a0468331761b497992e9d554c210583781308272 Pick-to: 6.1 6.2 Task-number: QTBUG-95199 Change-Id: I04c77f659b82269bb8010ea262b2e51f36e9def3 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* fix warning in cborparser with gcc 11.1Andreas Buhr2021-07-071-1/+2
| | | | | | Pick-to: 6.2 Change-Id: Ie8270f2b156b194dedd115a97b93f7f800af055e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* MSVC: Enable warnings-are-errors for latest Visual Studio 2019Kai Köhne2021-06-231-4/+3
| | | | | | | | | Also remove handling of older versions, because we only support Visual Studio 2019 currently Pick-to: 6.2 Change-Id: If66a46d970047fe25582e323df74e0a904ee92da Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Disable -Werror=stringop-overflow on GCC >= 10Giuseppe D'Angelo2021-06-231-0/+8
| | | | | | | | | | | There's a number of upstream bugs that cause false positives; do not make them errors. Change-Id: I4151794d8d37177a47a34aef8d83accf4377d44a Pick-to: 6.1 6.2 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add GCC 11 and C++20 workaroundsGiuseppe D'Angelo2021-06-181-0/+11
| | | | | | | | | | | | | | | | | | | | | GCC 11.1 has a bug [1] in the preprocessor that leads to -Wsuggest-override warnings being raised in random places, even under pragmas that are supposed to suppress it. For some reason, NOT using the integrated preprocessor fixes it, so add that flag as a workaround. Also, GCC 11 introduces a family of warnings for C++20's deprecations of mixed enum arithmetic, which we use all over the place. Avoid a hard error for those warnings. [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100796 Change-Id: I3b2aefa385f191f207e7eb876bc1ed0b18fb342b Pick-to: 6.1 6.2 Task-number: QTBUG-93360 Task-number: QTBUG-94059 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Fix the win32-clang-msvc targetAllan Sandfeld Jensen2021-06-151-1/+1
| | | | | | | | Detect clang-cl mkspec target Pick-to: 6.2 Change-Id: If0ca31ae2da3b44a4e2bd116933007139cc02fdc Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Enable UNICODE for all Qt targets and Qt consumers by defaultAlexey Edelev2021-05-211-8/+5
| | | | | | | | | | | | | | | | | | After discussion we decided to opt-out the UNICODE definintion behavior. To disable UNICODE in user projects the qt6_disable_unicode_defines function could be used. Amends 5b64e5950cf984abb7d47e0802bcb4b5a21e06fa [ChangeLog][CMake] Enables the UNICODE and _UNICODE definitions on WIN32 platforms by default for all cmake projects to reflect the qmake behavior. Use qt6_disable_unicode_defines function to disable the default unicode definitions. Pick-to: 6.1 Fixes: QTBUG-93895 Change-Id: Id70ff7dcf8c74f660ec851f8b950e1e3b94d9fb4 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Allow enabling Apple app extension API in other reposAlexandru Croitor2021-04-231-3/+0
| | | | | | | | | | | | | | It's needed in qtconnectivity, but currently the qt_disable_apple_app_extension_api_only function is defined in QtInternalTargets.cmake which is loaded only in qtbase. Move the function to cmake/QtTargetHelpers.cmake. Amends e189126f1ae1d2fa2ad0f95ee2c4aa72c770a97b Pick-to: 6.1 Change-Id: Ia2470e48a91385239394368780f5bbb223000113 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* MSVC: define _CRT_SECURE_NO_WARNINGS for all internal CMake targetsLi Xinwei2021-04-201-0/+1
| | | | | | | | | | | | | | | | | In commit 013abe320680b3dcd3f6d7e4fb4880e590ba10e6, I add _CRT_SECURE_NO_WARNINGS definition for all Qt internal module targets, to suppress MSVC warnings like: warning C4996: 'strncpy': This function or variable may be unsafe. However, when compiling some internal tools, such as qmake and qdoc, such warnings also exist. To suppress this kind of warning entirely, _CRT_SECURE_NO_WARNINGS definition should be added for all Qt internal targets when using MSVC compiler. Pick-to: 6.1 Change-Id: I9c37b20672f9d0f470e3e9ea847e5221f43bfc04 Reviewed-by: Yuhang Zhao <2546789017@qq.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Make Platform a dependency for all Qt internal targetsAlexandru Croitor2021-03-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | In particular that influences BundledLibrary targets. Most internal targets already depended transitively on Qt::Platform via Qt::Core as a public dependency. This was not the case for BundledLibrary targets which don't link to Qt::Core. This led to compilation issues in user projects when targeting WebAssembly, due to mismatched flags between a bundled Harfbuzz vs a user project. Probably other subtle issues as well (e.g. none of the Windows specific compile definitions were passed to bundled libs). Bundled libraries depend on PlatformCommonInternal already, so make PlatformCommonInternal turn depend on the public Platform target. I thought that was already the case, but we merely relied on the Qt::Core dependency. Note that Qt::Core should still list Platform as a public dependency, so it gets propagated to user projects. Amends acf9b3a68b98b806329dd92184e632e049441cec Change-Id: Ida3b219818f89ec6eba2c2d92c5db65ad56bc5a4 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Tune compilation flags to reduce libraries sizeAlexey Edelev2021-01-221-0/+5
| | | | | | | | | | | | Add '_WINDLL' definition for the MSVC compilers family. Check the 'FEATURE_optimize_size' value before replacing compiler flags in the qt_internal_add_optimize_full_flags function. This is required, because Qt::Core and Qt::Gui modules lost their ability to shrink, when selecting the appropriate build type or features. Fixes: QTBUG-89952 Change-Id: I982c25ea84e4793b4006ead0ee516b3f3eb2a054 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Move UNICODE and _UNICODE definitions to internal platform targetAlexey Edelev2021-01-191-0/+4
| | | | | | | | | | Move UNICODE and _UNICODE definitions from the public Qt::Platform target to the private Qt::PlatformCommonInternal target. Fixes: QTBUG-89951 Change-Id: Ib4c1c4cab74acda0a43c4ddb3cffd3954393dc89 Reviewed-by: Kai Koehne <kai.koehne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* CMake: Add --enable-new-dtags flag supportAlexey Edelev2020-12-221-0/+4
| | | | | | | | | | | | | 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>
* MSVC: Enable control flow guard for release buildsYuhang Zhao2020-12-071-2/+6
| | | | | | | | | | | | | | | | | | This makes the applications and libraries more safe and won't cause any binary incompatibility. It's not supported for MSVC 2015, but since we only support MSVC 2019 or later in Qt6, it's safe to use this parameter. The "-guard:cf" parameter is supported by clang-cl and intel-cl as well, MinGW doesn't support it. [1] https://docs.microsoft.com/en-us/cpp/build/reference/guard-enable-control-flow-guard?view=msvc-160 [2] https://docs.microsoft.com/en-us/cpp/build/reference/guard-enable-guard-checks?view=msvc-160 Change-Id: I7b035b4b0f22617a7f3c067cddde0bed2e13dd1c Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* MSVC: enable identical COMDAT folding for release buildsYuhang Zhao2020-11-121-1/+1
| | | | | | | | | | | | | | | According to Microsoft's docs, /OPT:ICF is enabled by the linker by default unless /OPT:NOICF or /DEBUG is specified. If we are in RelWithDebInfo mode, /DEBUG is passed to the linker to generate debug symbols, however, it caused the identical COMDAT folding be disabled. We now pass /OPT:ICF to the linker explicitly to prevent this. [1] https://docs.microsoft.com/en-us/cpp/build/reference/opt-optimizations?view=msvc-160 Change-Id: I02099edb81034ace7bb19f1164d57829e3979a5f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: don't add the same parameter twiceYuhang Zhao2020-11-041-9/+1
| | | | | Change-Id: Ic5001f296b56f1181f5e37718e090f931eca8b50 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* cmake: Always add -Wno-ignored-attributes for clang targeting windowsMartin Storsjö2020-11-041-6/+7
| | | | | | | | | | | This matches how it is in the qmake mkspec, silencing a lot of warnings - but contrary to when building with qmake, it's only applied when building Qt itself. For external projects built with cmake, the Qt headers are included with -isystem, which silences any warnings from those headers. Change-Id: I1a498d3c2715cb73e647668cb7226ceeffb7ff0b Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* cmake: Set a warning flag based on the target arch, not build hostMartin Storsjö2020-11-031-1/+1
| | | | | Change-Id: I0b524d52286210b7782dd710467fbc3a742d0c08 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Improve clang-cl support for Qt6Yuhang Zhao2020-11-021-3/+7
| | | | | | | | | | 1. clang-cl doesn't support "-fno-exceptions", it uses msvc's parameter. 2. some parameters supported by msvc are not supported by clang-cl and they are causing huge warning message flood, don't add them. 3. use correct optimize parameter for clang-cl. Change-Id: Idbadf139127143c5fa6c49068588cb26f47da7a2 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add externConstexpr to MSVC compile optionsUlf Hermann2020-10-131-0/+5
| | | | | | | | We want this in order to be able to export constexpr members. Change-Id: I33ba7964ebee54fe656df983985d8d6fa0b99358 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* CMake: Fix build with Clang on WindowsKai Koehne2020-09-111-0/+6
| | | | | | | | | | | win32-clang-g++/qmake.conf did define QMAKE_CFLAGS_WARN_ON += -Wextra -Wno-ignored-attributes probably for the same reason. Change-Id: I14b66f2555949c03a2ea996923e31f5ec9f7105a Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Implement configure -force-assertsJoerg Bornemann2020-08-271-0/+4
| | | | | Change-Id: Ife15b8d008c5b3f5eed61ec3bc048fda4c4b4e46 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Implement configure -gdb-indexJoerg Bornemann2020-08-231-0/+4
| | | | | Change-Id: Iea0fb99297751b1baf830a416ea5041d0b9a3b63 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Implement configure -linker [bfd,gold,lld]Joerg Bornemann2020-08-201-0/+8
| | | | | | Fixes: QTBUG-86155 Change-Id: I5ba2d3b52d9ca240b48904c492f7902a056c0292 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Add /OPT:REF flag when building Qt on WindowsAlexandru Croitor2020-08-191-0/+7
| | | | | | | | | | | | In qmake it's done for all qmake projects, in CMake we lean on the safe side and apply it to building Qt itself. User CMake projects can then choose to add it themselves. Task-number: QTBUG-85992 Change-Id: I51919f947d43ffd9925e3d2837dcad17e480367d Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* CMake: Handle -D, -I, -F and -L configure argumentsJoerg Bornemann2020-08-171-0/+19
| | | | | | | | | | | | | | Introduce new CMake variables and map -D to QT_EXTRA_DEFINES, -I to QT_EXTRA_INCLUDEPATHS, -L to QT_EXTRA_LIBDIRS, and -F to QT_EXTRA_FRAMEWORKPATHS. Those variables only affect the Qt build, not user projects. Fixes: QTBUG-85878 Change-Id: I229df2eed1505a2619068d0d32975962b052569a Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Don't use lld linker for Android with a Windows hostAlexandru Croitor2020-08-061-1/+4
| | | | | | | | | | | | Most of the time lld just gets stuck (deadlock) waiting on some mutex, thus failing integrations. Amends 64c111e10fcb2f69855432177d76649b6b789fac Task-number: QTBUG-85911 Change-Id: Id73bf967a7aeb0e0cbccfaafe056b325c8711f82 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* CMake: Introduce qt_internal_add_appAlexandru Croitor2020-07-311-2/+6
| | | | | | | | | | | | | | | This new function is meant to be used where load(qt_app) is used. It delegates functionality to qt_add_executable, while handling some additional behavior via a finalization function (mostly handling of macOS Info.plist files and icons, as well as Windows icons and resource files) It uses a new PlatformAppInternal interface target. Task-number: QTBUG-85757 Change-Id: I1a2d5851b137fcd4a6323e0e06fb154f91619800 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Add -Wsuggest-override for gcc >= 9.2Alexander Volkov2020-07-241-0/+4
| | | | | | | | | gcc doesn't report warnings for final methods since version 9.2: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78010 Change-Id: I7152351aac0e3bad86d777e119f25137ef97ec6f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Limit OpenGL deprecation silencing on Apple platform to Qt itselfTor Arne Vestbø2020-07-021-0/+10
| | | | | | | | | | | | | | | | | | | | | Apple deprecated the entire OpenGL API in favor of Metal, which we are aware of, so we don't need to see the warnings when building Qt. Instead of applying the silencing globally for all Qt consumers, both internal and external, we now limit the silencing to Qt itself. That means user code that explicitly uses any of the deprecated APIs will see the warnings. Note that this does not apply to merely using any of the Qt OpenGL APIs. The user has to explicitly use the platform APIs that have been deprecated. The warnings need to be disabled on a build system level, so that that they are passed as -D flags on the command line. If the defines were done in Qt headers (qguiglobal.h e.g.), they would require the user to always include this header before any of the Apple headers. Change-Id: I3f2a2a5211332a059ad4416394251772c677fdcb Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* CMake: Enable bitcode when targeting UIKIT aka iOSAlexandru Croitor2020-07-011-0/+16
| | | | | | | | | | | | | | | | | Building an iOS app with qmake failed because Qt itself was not built with bitcode enabled. Enable building with bitcode. Make sure qrc resource files and bundled 3rd party libraries also build with the regular Qt module flags and thus with bitcode enabled. As a consequence gc_sections has to be disabled for UIKIT platforms. Task-number: QTBUG-82581 Task-number: QTBUG-84781 Task-number: QTBUG-85240 Change-Id: I15fe668725a139c02f2a32a5db849b46d4ce325c Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>