summaryrefslogtreecommitdiffstats
path: root/cmake
Commit message (Collapse)AuthorAgeFilesLines
* cmake: Add known translations to CFBundleLocalizations in Info.plistTor Arne Vestbø2023-06-021-0/+57
| | | | | | | | | | | | | | | | | | | For untranslated applications we set CFBundleAllowMixedLocalizations to true, so that the application's locale will not be limited to the development region "en". But once we have a set of known translations, added by qt_add_translations, we can turn these into CFBundleLocalizations, which lets macOS/iOS choose a best match between what the app supports and what the user preferences are. [ChangeLog][Internationalization] Translations added via qt_add_translations are now reflected as CFBundleLocalizations entries in the application's Info.plist file on Apple platforms. to disable this behavior, set QT_NO_SET_PLIST_LOCALIZATIONS. Change-Id: I3f7ae1a1884eaf269038fa8ee49dbe6cac855706 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* cmake: Always copy Info.plist to build directory manuallyTor Arne Vestbø2023-06-021-7/+5
| | | | | | | | Allows us to modify this file in place, before CMake copies it into the application bundle during its generator step. Change-Id: I73325c66b5b8919f57dbaa1cc76a7edbc145609c Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Set QT_FORCE_FEATURE_neon to ON for x86_64h arch as well, on macOSAmir Masoud Abdol2023-06-011-1/+2
| | | | | | | | | | | We were not accounting for `x86_64h` arch, and as a result cross-compiling with `-DCMAKE_OSX_ARCHITECTURES="x86_64h;arm64` was failing. Pick-to: 6.5 Fixes: QTBUG-113694 Change-Id: Ieb50a7a62aabcca76b09f9c853b3faf915eab1a3 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Set CMAKE_<LANG>_FLAGS in PARENT_SCOPE as wellAmir Masoud Abdol2023-06-011-3/+11
| | | | | | | | | | Previously, we were not setting the CMAKE_<LANG>_FLAGS, instead we were only processing the CMAKE_<LANG>_FLAGS_<CONFIG>. This patch amends that so we also update the default flags list as well. Pick-to: 6.5 Change-Id: I7ceb87850a806fe8ad4eac6f8147b312eba01bc6 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* cmake: Copy template Info.plist for macOS manually, like we do for iOSTor Arne Vestbø2023-06-014-22/+36
| | | | | | | | | Unifies the approach between iOS and macOS. By copying the Info.plist to the build directory, we also open up the possibility to modify it, which we can't do when CMake does the copy during its generator step. Change-Id: I59f9f69ac368166bb26d8a5c57bf4ea3f503d51b Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add TRY_RUN option to qt_internal_add_toolAmir Masoud Abdol2023-06-011-1/+54
| | | | | | | | | | | | | | | | | To make sure that Qt essential tools can be executed after a successful build, we can now pass the TRY_RUN argument to `qt_internal_add_tool`. On Windows, this option creates a custom command and a custom target (${target}_try_run) for the tool, and tries to run the tool from a batch script. If the program fails to run because of missing libraries, an error will be shown, and build halts; otherwise, `${target_name}_try_run_passed` file will be generated and the build continues. Pick-to: 6.5 Task-number: QTBUG-113273 Task-number: QTBUG-112747 Change-Id: I760588714bcf9db69505abe3df717733352a8284 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Implement qt_internal_get_file_path_mode for changing the file path modeAmir Masoud Abdol2023-05-311-0/+16
| | | | | | | | | | | | | In cases where we allow symlink, we need to use ABSOLUTE path, and don't resolve the symlink. This function returns ABSOLUTE only if we are on Apple platform, and have QT_ALLOW_SYMLINK_IN_PATHS enabled. While this is mainly to resolve the issue report by Homebrew, it might be useful if a user really want to build with symlink. Pick-to: 6.5 Task-number: QTBUG-113463 Change-Id: Ided141ed8de66cc1d3717ec2719eb703fa7fc589 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Add NOMINMAX to PlatformCommonInternalAmir Masoud Abdol2023-05-312-0/+6
| | | | | | | | | | | | By not explicitly disabling min/max macros of `windows.h`, we may see some unintended substitutions. This is especially important now that we are moving toward enabling Unity Build, and some of the constructs for manually dealing with this issue, eg., `#ifdef max`, `#undef max`, might not make it to the pool, and as a result we get build failure. Pick-to: 6.5 Change-Id: Ie3c31aebe00300126a2ac3a6044876ab92d5d99c Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Avoid adding the redundant install rules for module headersAlexey Edelev2023-05-311-1/+1
| | | | | | | | | If module doesn't contain headers we should skip adding install rule of the geneated by syncqt module headers, since the staging directory will not be created in this case. Change-Id: I89db5f1447d60cae48cd6ae4b9ef080dcf50e34c Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix Clang platform detecting mechanismAlexey Edelev2023-05-311-8/+8
| | | | | | | | | | | | | CMake not necessarly sets MSVC or MINGW when detecting Clang compiler. We should rely on CMAKE_CXX_COMPILER_FRONTEND_VARIANT instead when detecting Clang platform. Fixes: QTBUG-113630 Pick-to: 6.5 6.2 Change-Id: I8c14939ddc0839ddf2b3419392aa843deeef4bb5 Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* CMake: make compile options consistent for Qt created librariesYuhang Zhao2023-05-312-3/+4
| | | | | | | | | | Currently some libraries created by Qt are lacking some compile definitions and compile options, and this issue is causing us troubles when building Qt statically. This patch tries to reduce the parameter difference when compiling Qt's own libraries. Change-Id: I3842943a874fab32ef90980e8aa29f5beb01feeb Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Fix version script testAlexey Rochev2023-05-301-20/+18
| | | | | | | | | | | | | | 1. Don't reassign different versions to same symbol 2. Define symbols used This fixes warnings with LLD linker (or errors if -Wl,--fatal-warnings is added by toolchain e.g. with Android NDK) 3. Add -Wl,--version-script to CMAKE_REQUIRED_LINK_OPTIONS instead of CMAKE_REQUIRED_FLAGS to prevent unused argument warning in compilation phase (there is no need for _SAVE variable because we are inside a function and our CMAKE_REQUIRED_LINK_OPTIONS won't escase its scope) 4. Fix removal of version script file (incorrect file name was used) Pick-to: 6.2 6.5 Task-number: QTBUG-111514 Change-Id: I0a1548c4268ad511760a0d4aa69ba7a0bdcbb0bc Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Replace AUTO_RESOURCE_PREFIX with RESOURCE_PREFIX in qt-cmake-projectAmir Masoud Abdol2023-05-301-1/+1
| | | | | | | Pick-to: 6.5 Change-Id: I53b9e8887e8e79c1c1e836c514171aece8cf35aa Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: use VS2019's flag for stronger inliningYuhang Zhao2023-05-291-2/+2
| | | | | | | | | | | | | Use the new "/Ob3" flag introduced in VS2019 to increase the inline level, which may give better performance. For compilers older than VS2019, we still use the traditional "/Ob2" inline level. Official documentation: https://learn.microsoft.com/en-us/cpp/build/reference/ob-inline-function-expansion?view=msvc-170 Change-Id: I34a50f27a151cb7c09f0085dd037a385c71848aa Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Break some include cycles in qglobal.h [1/3]Ahmad Samir2023-05-261-4/+4
| | | | | | | | | | | | | | | | Remove qglobal.h include from qcompilerdetection.h, qsystemdetection.h and modulecppexports.h.in Testing locally, the code builds on Linux with precompiled headers disabled/enabled (qt_pch.h includes qglobal.h, so building with PCH enabled isn't useful for testing this) and with/without bootstrap. qrunnable.*: missing includes detected by compiling with -DFEATURE_headersclean=ON. Task-number: QTBUG-106722 Change-Id: I70864dfbf117ffd7fe492eb715a413eb6f209990 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Make CONFIGS arguments of qt_internal_remove_compiler_flags optionalAmir Masoud Abdol2023-05-261-8/+15
| | | | | | | | | | | There was a discrepancy between what the comment was saying, and what the function was doing before, and with this patch, we opt for what the comment was saying, which makes more sense. In addition, I cleaned up its documentation a bit. Pick-to: 6.5 Change-Id: I07c20f93aa5c8e9bc942f5e69f0cf8299f4a813e Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Add the list of previously searched packages to qt_find_packageAlexey Edelev2023-05-263-4/+17
| | | | | | | | | | | | | | | | | | | | | | | | When configuring Qt the second time it might be situation that the set of qt_find_package calls is changed. One of the scenarios is the changing of the submodule list that needs to be built in top-level builds. It's also applicable for Qt features that lead to extra package lookup in the unlocked subdirectories. Current approach collects packages that were found at the previous run and skips search of the packages that are missing. The problem is that it also skips packages even if qt_find_package was not called at previous run. QT_INTERNAL_PREVIOUSLY_SEARCHED_PACKAGES collects all packages that were actually searched at the previous run to make sure that qt_find_package don't skip packages that appeared at second run only. Note: Described scenarios may still have other issues and are not tested well. Fixes: QTBUG-113244 Pick-to: 6.5 Change-Id: Iab36060a28fbaa16a3b3bdba67795955c496b0c3 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
* Remove the -no-gcc-sysroot configure optionJoerg Bornemann2023-05-261-3/+0
| | | | | | | | This option is dysfunctional since Qt 6.0. Modify the CMake variables CMAKE_SYSROOT_LINK and CMAKE_SYSROOT_COMPILE instead. Change-Id: Ib97dcc765c4644b5c3975d4b61c0e567451ea977 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Remove the -silent option from configure-cmake-mapping.mdJoerg Bornemann2023-05-261-1/+0
| | | | | | | There's just no good equivalent with the CMake based build. Change-Id: I923ef3173d631afe2db0bdacc1d02c1f4649b741 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* CMake: Remove the -mp configure optionJoerg Bornemann2023-05-261-1/+0
| | | | | | | | This configure option is dysfunctional since Qt 6.0. If you really want to add the /MP compiler option, add it to CMAKE_CXX_FLAGS. Change-Id: I00b535067944df52abbadb424ec03e53aa41c819 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* CMake: Remove the -make-tool configure optionJoerg Bornemann2023-05-261-1/+0
| | | | | | | | This configure option is dysfunctional since Qt 6.0. Use -cmake-generator instead. Change-Id: Idb147ec8087018dab3ac0e571eeff7d1f18e34f6 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Remove -list-libraries from configure-cmake-mapping.mdJoerg Bornemann2023-05-261-1/+0
| | | | | | | This Qt5 configure argument does not exist anymore. Change-Id: I68c798eb2769c93e3ca0b30d6a3da3247e319eee Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* network: fix link issue with older libcSamuli Piippo2023-05-261-4/+8
| | | | | | | | | | | | | | | | | | | | | | Amend 68b625901f9eb7c34e3d7aa302e1c0a454d3190b and fix link issue with slightly less modern libc/libresolv where not all functions have been moved over to libc. ld: src/network/CMakeFiles/Network.dir/kernel/qdnslookup_unix.cpp.o: in function `QDnsLookupRunnable::query(QDnsLookupReply*)': qdnslookup_unix.cpp:(.text+0x183): undefined reference to `__res_nquery' ld: qdnslookup_unix.cpp:(.text+0x437): undefined reference to `__dn_expand' ld: qdnslookup_unix.cpp:(.text+0x621): undefined reference to `__dn_expand' ld: qdnslookup_unix.cpp:(.text+0x8ff): undefined reference to `__res_nquery' ld: qdnslookup_unix.cpp:(.text+0xbd7): undefined reference to `__dn_expand' ld: qdnslookup_unix.cpp:(.text+0xd7f): undefined reference to `__dn_expand' ld: qdnslookup_unix.cpp:(.text+0xf4f): undefined reference to `__dn_expand' ld: qdnslookup_unix.cpp:(.text+0x10fa): undefined reference to `__dn_expand' ld: qdnslookup_unix.cpp:(.text+0x131c): undefined reference to `__dn_expand' collect2: error: ld returned 1 exit status Change-Id: If81b292222c78d828b9fef61f30a62f1d584c183 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* WASM: fix build errorYuhang Zhao2023-05-241-1/+1
| | | | | | | | | CMake gives me an error if the double quotation marks are missing. Pick-to: 6.5 Change-Id: I83a6037dde7503bf2e6fa9316aed732d5ef08576 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
* WASM: fix wrong parameter passed to CMake functionYuhang Zhao2023-05-241-1/+1
| | | | | | | | The function needs TRUE/FALSE, not NO_EXCEPTIONS. Change-Id: I3e173e26fafc02996577466afd09e85351a0380f Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Prefer GSS.framework on macOS over libgssapi_krb5.tbd when using vcpkgAmir Masoud Abdol2023-05-231-5/+16
| | | | | | | | | | | | | | | | | | | On macOS, vcpkg toolchain sets the value of CMAKE_FIND_FRAMEWORK and CMAKE_FIND_APPBUNDLE to LAST which causes an issue when it comes to GSSAPI. This change in behavior leads to FindGSSAPI.cmake finding `usr/lib/libgssapi_krb5.tbd → Kerberos.framework` instead, which is not exactly what we want, and it misses some necessary symbols, and as a result Network fails to build.¹ We need to make sure that we find `GSS.framework`. Here by dropping the alternative name on Apple platform, we end up getting the Framework even if vcpkg prefer finding the framework LAST. [1]: https://github.com/microsoft/vcpkg/issues/23782 Pick-to: 6.5 Change-Id: I0e7e6272dcb0fdf2c746149d2969468d66ca9ec2 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Make sure that QT_QMAKE_TARGET_MKSPEC is not emptyAlexey Edelev2023-05-232-3/+19
| | | | | | | | | | | | | | | If target platform is not detected the QT_QMAKE_TARGET_MKSPEC variable remains empty. We need to check this explicitly. Also store the default QT_QMAKE_TARGET_MKSPEC variable in the target toolchain file. This is useful if users want to build repos one-by-one or build standalone tests without the need to specify the QT_QMAKE_TARGET_MKSPEC each time when configuring new repo or tests. Task-number: QTBUG-113630 Pick-to: 6.5 6.2 Change-Id: I57dfc6c97752a645868d77998d8f52e16bdfd5c8 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Require only module-specific sync_headers for header_check targetAlexey Edelev2023-05-231-1/+1
| | | | | | | | | | | Use the module-spefic sync_headers target when specifying dependencies for the headersclean custom command. Pick-to: 6.5 Fixes: QTBUG-113643 Change-Id: I6eb6f4a8881b252f7732ecfa79a9893ace5ce19f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Don't run version script test when its result won't be usedAlexey Rochev2023-05-231-26/+23
| | | | | | | | Pick-to: 6.2 6.5 Task-number: QTBUG-111514 Change-Id: Ibcac8cd591125f173e906e256d08593764a1cf66 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* wasm: add INSTALL_LIBDIR as library search pathMorten Sørvig2023-05-221-0/+6
| | | | | | | | | Fixes error where Emscripten fails to find Qt library dependencies at application link time. Change-Id: I03b154f60ab5dc3a4c8d0d21d47551c9584029a2 Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io> Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
* rhi: Make it a QPA-style private but semi-public APILaszlo Agocs2023-05-214-4/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qrhi.h, qshader.h, qshaderdescription.h (and qshaderbaker.h from shadertools; done separately) become "RHI APIs", following the concept of QPA APIs. Mirror completely what is done for QPA headers, but using the "rhi" prefix for the headers. This involves updating syncqt to handle the new category of headers. (a note on the regex: matching everything starting with "qrhi" is not acceptable due to incorrectly matching existing and future headers, hence specifying the four header names explicitly) There is going to be one difference to QPA: the documentation for everything RHI is going to be public and part of the regular docs, not hidden with \internal. In addition to the header renaming and adding the comments and documentation notes and warnings, there is one significant change here: there is no longer a need to do API-specific includes, such as qrhid3d11[_p].h, qrhivulkan[_p].h, etc. These are simply merged into a single header that is then included from qrhi.h. This means that users within Qt, and any future applications can just do #include <rhi/qrhi.h> (or rhi/qshader.h if the QRhi stuff is not relevant), no other headers are needed. There are no changes to functionality in this patch. Only the documentation is expanded, quite a lot, to eliminate all qdoc warnings and make the generated API docs complete. An example, with a quite extensive doc page is added as well. Task-number: QTBUG-113331 Change-Id: I91c749826348f14320cb335b1c83e9d1ea2b1d8b Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Make sure that -utf-8 flag only apply to MSVCAlexey Edelev2023-05-161-1/+1
| | | | | | | | | | | | | | | | INTERFACE scope propagates the '-utf-8' flag to the target dependencies. So if Qt is built using MSVC, but the depending targets use different compiler this flag will break the compilation. Guard the flag using genex. Amends e3cc2487ce63cae42d8054b38fdb54abe8545007 Pick-to: 6.5 Task-number: QTBUG-112737 Change-Id: Ie0576667108820dd61035debfc1fcc030ef3536a Reviewed-by: Lars Schmertmann <lars.schmertmann@governikus.de> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Remove the -sysroot option from configureAmir Masoud Abdol2023-05-122-2/+8
| | | | | | | | | | | | The `-sysroot` does not have any effect, and it can be removed. I added a warning in case someone is still using it. [ChangeLog][configure] The -sysroot option was removed. Use CMAKE_SYSROOT or CMAKE_TOOLCHAIN_FILE instead. Task-number: QTBUG-112951 Change-Id: Ib180b891ca8228ef1ebf9be43f2f6b8b5b5b0ee7 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Network: link directly to libresolv instead of dlopen()ing itAmir Masoud Abdol2023-05-111-0/+49
| | | | | | | | | | | | | | | | | | There's little need for us to dynamically load it. The reasons why that was necessary aren't in the public history (Qt 4.5 already had it[1]). I remember writing the code in 2007-2008, I just don't remember why. On modern Linux and FreeBSD, there's no libresolv.so any more and those symbols have been rolled up into libc.so. It's still necessary on Darwin systems, so this commit introduces WrapResolv. It also resolves the unity build issues relating to libresolv symbols. [1] https://code.qt.io/cgit/qt/qt.git/tree/src/network/kernel/qhostinfo_unix.cpp?h=v4.5.1 Task-number: QTBUG-109394 Change-Id: Ic5799e4d000b6c9395109e008780643bac52122b Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Make sure that -Zc:__cplusplus, and -permissive- only apply to MSVCAmir Masoud Abdol2023-05-111-1/+2
| | | | | | | | | | | | As described in the bug report, in cases where host Qt is built using MSVC, these flags may leak to user projects if they are set to be configured by a different compiler, e.g., Clang. Pick-to: 6.5 Fixes: QTBUG-112737 Change-Id: Iad922e24cc7e7f835e08ed37271dfbedc6e38dbe Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* headerscheck: enable exceptions for MSVCThiago Macieira2023-05-051-1/+1
| | | | | | | | | | | MSVC's own headers trigger the C4530 warning just by being included. C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.33.31629\include\chrono(2206): error C2220: the following warning is treated as an error warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc Change-Id: Ieab617d69f3b4b54ab30fffd175c02c23f677d75 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Introduce QT_ALLOW_SYMLINK_IN_PATHS flagAmir Masoud Abdol2023-05-031-0/+2
| | | | | | | | | | | `QT_ALLOW_SYMLINK_IN_PATHS` disables the `qt_internal_check_if_path_has_symlinks` command. This allows people of Homebrew to get their build working without having to patch the entire function, as they currently do. Pick-to: 6.5 Change-Id: I4fed3ca497684364eaabbdbc44f1e148e3f28bd7 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Do not use REALPATH when collecting Qt header filesAlexey Edelev2023-05-031-2/+0
| | | | | | | | | | | | | | | CMake doesn't resolve REALPATH for the non-existing files. This limitation blocks the use of REALPATH when collecting the generated module header files. The real path should be resolved by syncqt implicitly and CMake scripts should rely on ABSOLUTE paths only, which should be consistent for any files including the generated files. Task-number: QTBUG-113295 Pick-to: 6.5 Change-Id: I0219c7bf34ef6a6589c6d5fade4c2ed3f8036ef0 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
* Remove duplicated syncqt arguments from the rsp fileAlexey Edelev2023-05-031-1/+0
| | | | | | | | | | syncqt_args is initialized with common_syncqt_arguments, so no need to append the same values one more time. Pick-to: 6.5 Change-Id: I1588ed438b7df0b0533ad3963ca96960dd5a8dbb Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
* CMake: Fix a typo in QtModuleHelpers.cmakeChristophe Marin2023-05-021-2/+2
| | | | | | | | | Rename is_staitc_lib_during_static_qt_build to is_static_lib_during_static_qt_build. Pick-to: 6.5 6.2 Change-Id: Iec0f4d5d025e07a857a086e960eaf7b6fa2638a5 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Fully rebuild dirty configure-time executablesJoerg Bornemann2023-04-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: "ninja clean" does not fully clean the build directories of configure-time executables (e.g. syncqt). This can lead to problems when building with compiler and linker launchers: on configure time, the launchers are not used (compare CMake issue #20762). After a "ninja clean", the executable might be removed but the object files are still there. This leads to a situation where the object files have been created without the compiler launcher but are linked with the linker launcher. We encountered a situation however, where the linker launcher requires the usage of the compiler launcher. The configure-time executable has a ${target}_build custom command that runs "cmake --build" and creates a timestamp file to track when to build the target. To circumvent the problem of stale object files we add the "--clean-first" argument to that target to fully rebuild configure-time executables if the timestamp file is out of date. The performance this imposes is negligible, because 1. Those configure-time executables are seldom out of date. 2. They are supposed to be "tiny executables with system dependencies only" anyway. Pick-to: 6.5 Change-Id: I701f9089f5ad941ffdf235aeccc3119b68c4e3e3 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Add message if syncqt is crashed without any outputAlexey Edelev2023-04-261-0/+8
| | | | | | | | | | | | | If syncqt process crashed due to the incompatibility with the standard library CMake doesn't produce any useful output. This adds the message that will give short explanation and possible solutions to fix this behavior. Pick-to: 6.5 Task-number: QTBUG-112747 Change-Id: Ib51aec19e3fcacf07515a3d20d72f89753bcdc33 Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Introduce the qt_internal_project_setup macroAlexey Edelev2023-04-243-2/+12
| | | | | | | | | | | | The macro sets the required CMake variables and policies and should be called right after the find_package(Qt6 COMPONENTS BuildInternals... call to make sure that the subsequent code adopt all the required policies. Pick-to: 6.5 Task-number: QTBUG-112685 Change-Id: I9f93f728ee4d8ae7743db9fffafa26025c76dcf2 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Store unsanitized plugin type names in module .json filesJoerg Bornemann2023-04-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | The module information .json gained a "plugin_types" key in 6.5.0. Unfortunately, this contained the "sanitized" version of plugin types, meaning dashes converted to underscores. For plugin types that contain dashes, e.g. wayland-decoration-client, the file contained wayland_decoration_client, which doesn't match its plugin directory name. Since "unsanitizing" plugin names is hard and "sanitizing" is easy, we now store the unsanitized plugin names and burden the consumer of the module .json files with the sanitation task. [ChangeLog][CMake] The module information JSON files now contain the unsanitized plugin types of a module, e.g. wayland-decoration-client instead of wayland_decoration_client. Consumers of the module information file must sanitize plugin types themselves if necessary. Pick-to: 6.5 Fixes: QTBUG-112872 Change-Id: I09cc9406b360779087086707abee3d5219a24452 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add drive letter to source paths when calling qt-internal- scriptsAmir Masoud Abdol2023-04-141-0/+3
| | | | | | | | | | | | | Like qt-configure-module.bat, when building with unity build, CMake needs to know the full path of the source directory to be able to correctly generate its `*_cxx.cxx` files. So far, this seems to only affect Windows' LLVM/MinGW builds. By this patch, I make sure that we pass the full path to CMake. Pick-to: 6.5 Task-number: QTBUG-109394 Change-Id: Ida2da127ecba95856b6e0091936c471c2a116936 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Disable objc_msgSend stubs in static libs to maintain Xcode < 14 compatTor Arne Vestbø2023-04-131-0/+15
| | | | | | | | | | | | | | Xcode 14's Clang will emit objc_msgSend stubs by default, which ld from earlier Xcode versions will fail to understand. Disable these stubs explicitly for static libs, for as long as we support Xcode < 14. See https://github.com/llvm/llvm-project/issues/56034 Pick-to: 6.5 Fixes: QTBUG-112820 Change-Id: Id762873d61b9d147bf3eb6292297e7b80b7393e1 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Make MODULE_ROOT AbsoluteAmir Masoud Abdol2023-04-121-1/+2
| | | | | | | | | | | | | | | In unity build, when calling qt-configure-module.bat, if we don't pass an absolute path, CMake will not be able to resolve the header paths in `*_cxx.cxx` unity headers. So far, this only happens on Windows/LLVM, and it is probably an oversight on CMake side, as passing a path without drive letter is perfectly fine in most cases, and CMake can handle it. We don't need the TO_CMAKE_PATH, as `get_filename_component` also does the transformation. Pick-to: 6.5 Task-number: QTBUG-109394 Change-Id: I474750af13291cbf1a46a12be5fc4a0f6e88accf Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Fix linkage with lld 16.0Bernhard Rosenkränzer2023-04-112-14/+14
| | | | | | | | | | | | | | | | | | | lld 16.0 is more picky about symbol versioning than previous versions (and other linkers such as ld.bfd, gold or mold). It now errors out if a symbol is versioned but not defined (see 8796677de8900dc154aef45f8620c3f987a40291). Outside of detecting support for symbol versioning (fixed by 462832), this causes linking Qt6 libraries other than Qt6Core to fail because their linker scripts try to add versioning to qt_version_tag, which is defined in Qt6Core rather than the library being linked. The obvious (and working) fix is to version qt_version_tag only where it is defined (Qt6Core), but this is not what the original intent seems to be. Task-number: QTBUG-111514 Change-Id: I963d417befb0f6b2260c57f059eeda1fe79200c9 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Fix setting Android SDK/NDK from environment variablesJoerg Bornemann2023-04-111-8/+4
| | | | | | | | | | | | | | The checks for the environment variables ANDROID_SDK_ROOT and ANDROID_NDK_ROOT were guarded by if(DEFINED) conditions. However, these variables are *always* defined by the code that iterates over __qt_toolchain_used_variables earlier in the toolchain file. Change the existence checks into emptiness checks. Pick-to: 6.5 Change-Id: I6c87f86068817e45dd2325359827c6fa4dae6279 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
* Add `-Wno-error=stringop-overread` to warnings_are_errors_flagsAmir Masoud Abdol2023-04-071-0/+5
| | | | | | | | | | | Besides `stringop-overflow`, the `stringop-overread` is also buggy, and it has some false positives. If not silenced, this will break the unity build as several warnings are being emitted in qmetaobject.cpp, etc. Pick-to: 6.5 Change-Id: I708c81057c01d8d8fc9694c394c89602a2f6867b Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>