summaryrefslogtreecommitdiffstats
path: root/cmake
Commit message (Collapse)AuthorAgeFilesLines
* configure: Fix --developer-build argument (with two hyphens)Joerg Bornemann2 days1-2/+6
| | | | | | | | | | | | | | We never properly handled double-hyphen arguments like --list-features. However --developer-build worked by accident, because it did set INPUT_developer_build implicitly. Now, we don't automagically translate INPUT_foo to FEATURE_foo anymore, and --developer-build stopped working. Fix this by consistently handling -foo and --foo arguments. Change-Id: Ibf32979b419c28e0a8e1f810f03ae3f295b14c69 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* CMake: remove QT_EDITION from qconfig.priAntti Kokko9 days1-2/+0
| | | | | | | | | | | | | | | QT_EDITION is not used anywhere in Qt6, stop adding it to qconfig.pri. Packaging currently unnecessarily patches the edition when handling the first steps after integration and again during install time. Pick-to: 6.7 6.5 6.2 Change-Id: I0ad1933ec8fea741796fdf6d13f627a657aac401 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* CMake: add licenseRule.json to IDE projectsTim Blechmann11 days1-1/+4
| | | | | | | | | Some repos have licenseRule.json files. Adding them to the IDE projects. Pick-to: 6.7 Change-Id: I7fdc054d244d48e3343866775671d8f4f4c9390b Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Lucie Gerard <lucie.gerard@qt.io>
* cmake: Add opt-out for adding -no_warn_duplicate_libraries linker flagTor Arne Vestbø2024-04-181-1/+2
| | | | | | | | | | The classic linker (triggered via -ld_classic) doesn't support this flag, and we can't construct a genex that takes this into account, so add an opt-out for Qt WebEngine. Pick-to: 6.7 Change-Id: I62418e0ff37fe8f5bdda2fa8d01b36a8fd44542a Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Add preliminary support for Qt for visionOSTor Arne Vestbø2024-04-189-8/+96
| | | | | | | | | | | | | | | | | | | | | | Qt already runs on Vision Pro as "Designed for iPad", using Qt for iOS. This change enables building Qt for visionOS directly, which opens the door to visionOS specific APIs and use-cases such as volumes and immersive spaces. The platform removes some APIs we depend on, notably UIScreen, so some code paths have been disabled or mocked to get something up and running. As our current window management approach on UIKit platforms depends on UIWindow and UIScreen there is currently no way to bring up QWindows. This will improve once we refactor our window management to use window scenes. To configure for visionOS, pass -platform macx-visionos-clang, and optionally add -sdk xrsimulator to build for the simulator. Change-Id: I4eda55fc3fd06e12d30a188928487cf68940ee07 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Remove the headersclean featureAlexey Edelev2024-04-173-1/+12
| | | | | | | | | | | 'headersclean' shoudn't be a feature. The respective flag should behave like command-line switch that affects the only repo that it was passed for. This also avoids propagating of the headersclean feature between the different repos when qtbase was built with the headerclean enabled. Fixes: QTBUG-121722 Change-Id: I304cbc980b06030513c015a2016678a6a0965fed Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* wasm: introduce QT_BUILD_WASM_BATCHED_TESTSMorten Sørvig2024-04-171-5/+7
| | | | | | | | | | | | | | | | | | | We are selecting a subset of the tests for batching/CI, however this is done for the WASM configuration which interferes with non-batched tests. - we can only build and run tests which are in the batching subset - we are enabling threading tests which breaks the no-thread configuration. Add QT_BUILD_WASM_BATCHED_TESTS and enable for WASM and batching. There's then no restrictions on which tests can be selected for CI. Change-Id: I59a67b63e80cd00676cb28f916951d2a52b0ee2c Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* CMake: qt_internal_add_test - fix BLACKLIST file handlingTim Blechmann2024-04-131-4/+4
| | | | | | | | | Not all tests have targets that we can attach the BLACKLIST files to. Pick-to: 6.7 Change-Id: Ie0a2d72859877a8803802a4f7dc996944f002656 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: qt_internal_add_test - add BLACKLIST files to IDE projectsTim Blechmann2024-04-121-0/+5
| | | | | | | | | Tests can be blacklisted via BLACKLIST files. This patch adds these files to the generated IDE projects automatically when available. Pick-to: 6.7 Change-Id: Icef2c397ada823e7b1c380dbb224694f059891ff Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* CMake: split _extra_files targetsTim Blechmann2024-04-121-12/+57
| | | | | | | | | Separate config.tests, coin, cmake, licenses and changelogs into independent targets to keep the IDE projects more organized. Pick-to: 6.7 Change-Id: Ie33d45799621c2d7ec6f022ffcfac132ac4c7b94 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* cmake: add _extra_files IDE target from heuristicsTim Blechmann2024-04-121-0/+57
| | | | | | | | | | | Lots of files in the repos are not included into the generated IDE projects. Therefore we add utility targets (custom targets), which are populated by glob patterns, which should fit most files that are found in qt's subprojects. Pick-to: 6.7 Change-Id: I1b731e65f8db319d3cec817eea5c23a1eeaefb22 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Avoid using PACKAGE_PREFIX_PATH for configure-time executablesAlexey Edelev2024-04-111-5/+18
| | | | | | | | | | | | | PACKAGE_PREFIX_PATH is not defined in cmake versions 3.29.x. We should avoid referring the internal CMake variables. Use the calculated reverse relative path to the prefix path instead. Fixes: QTBUG-124186 Pick-to: 6.5 6.6 6.7 Change-Id: Iefae132e61a3f8e8f5525c0abd6a2d41631c2fb0 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Suppress the warning about unused QT_INTERNAL_CALLED_FROM_CONFIGUREAlexey Edelev2024-04-111-1/+3
| | | | | | | | Add the dummy check if the variable is defined to suppress the warning. Pick-to: 6.7 Change-Id: If3bb0ef6a2587693c0ec898ceb3080ebfc1e82a7 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Fix a misplaced > in pkg-config filesMartin Storsjö2024-04-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Qt CMake routines for generating pkg-config files don't handle all sorts of generator expressions, see qt_internal_set_pkg_config_cpp_flags in QtPkgConfigHelpers.cmake which hardcodes handling of some specific expressions. In this case, they don't handle the semicolon within the generator expression expansion. For the UNICODE and _UNICODE defines, this means that the pkg-config file ends up containing "-D_UNICODE>" with the trailing ">". (The pkg-config generator tries to parse out the generator expressions, but the semicolon gets handled as a higher level separator, leaving the closing bracket ">" behind.) This issue only shows up for mingw targets, because pkg-config files aren't generated in MSVC style builds. Escape the semicolon as $<SEMICOLON> to make it not break the surrounding generator expression, as parsed by the pkg-config file generator. The generator expressions aren't fully correctly evaluated for the pkg-config files though; the UNICODE and _UNICODE defines don't end up in the resulting pkg-config file even though they're used during compilation (both before and after this change). Fixes: QTBUG-103019 Co-authored-by: Martin Reboredo <yakoyoku@gmail.com> Pick-to: 6.7 6.5 6.2 Change-Id: Icdb380e3b42be2a47372a8ee2b61378a33c685f7 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Li Xinwei <1326710505@qq.com>
* cmake: Only enable warnings on/off flags for C/C++/Objective-C/C++Tor Arne Vestbø2024-04-071-2/+9
| | | | | | | | The flags are not valid for e.g. Swift Pick-to: 6.7 Change-Id: Ie5b46dc9147d8c024e7e27712c7b8632abd727d9 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* cmake: Selectively enable -no_warn_duplicate_libraries for Xcode 15+Tor Arne Vestbø2024-04-041-9/+9
| | | | | | | | | | | | We can't make the choice of whether to enable no_warn_duplicate_libraries or not based on the Xcode version Qt was built with, as the target flags will propagate to our cmake integration tests, which we run on platforms where we don't have Xcode 15. Pick-to: 6.7 Change-Id: I241a950a3d2e70652a3a6386e5dd86c681d1c13f Reviewed-by: Kai Köhne <kai.koehne@qt.io> Reviewed-by: Orkun Tokdemir <orkun.tokdemir@qt.io>
* CMake: fix unity builds of darwin's permission helperTim Blechmann2024-04-031-0/+3
| | | | | | | | | | CMake-3.29 supports unity-building of objc/objcpp. This patch fixes darwin's permission helper, which includes a source under a preprocessor define. Change-Id: I62e2d291c40ad7b1dbb5243eaee9bf8625473041 Pack-to: 6.7 6.6 6.5 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Add support for using an inline namespaces for -qtnamespaceFriedemann Kleint2024-04-032-0/+2
| | | | | | | | | | | | | | | Inline namespaces serve the purpose for which the original -qtnamespace option was added and allow for macro simplification (no need for any using directives). This makes it possible to use namespaced builds of Qt also for Qt for Python and similar use cases which have issues with the additional namespace. [ChangeLog][QtCore] It is now possible to use an inline namespace for -qtnamespace (option -qtinlinenamespace). Task-number: PYSIDE-2590 Change-Id: Ia0cecf041321933a2e02d1fd8ae0e9cda699cd1e Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* cmake: Propagate Qt's CMAKE_OSX_SYSROOT to user projects by SDK nameTor Arne Vestbø2024-04-032-15/+15
| | | | | | | | | | | | | | | | | | CMake will transform the CMAKE_OSX_SYSROOT into a path as part of Darwin-initialize.cmake, as non-Xcode generators rely on it to be a path when setting -isysroot. When propagating the CMAKE_OSX_SYSROOT to consumers of Qt, we need to propagate it by its original SDK name, so that CMake's Xcode generator can write it by name into the SDKROOT Xcode setting by name, and so that we don't lock the user into using the exact same SDK path (and version) as we did when building Qt. The QT_APPLE_SDK code path has been removed, as setting QT_APPLE_SDK will always set the CMAKE_OSX_SYSROOT as well. Change-Id: Ib1ef19b9dc375dddf76a2629ee790990c0722f75 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Hardening: fix _LIBCPP_HARDENING_MODEGiuseppe D'Angelo2024-03-271-1/+1
| | | | | | | | | | | | It seems we ended up passing "_LIBCPP_HARDENING_MODE_EXTENSIVE" (quoted), not just _LIBCPP_HARDENING_MODE_EXTENSIVE. Remove the quoting. Amends 9ff1e6d80bbd5b44b9ec4c0a837d9a4c962698e4 Change-Id: Ia396b0ef638d656a9ea947a378d5623c11e5a544 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Set the CMP0159 to NEW where applicableAlexey Edelev2024-03-272-0/+8
| | | | | | | | | The policy controls the file(STRING ... REGEX) behavior. This suppresses warnings produced by CMake versions >= 3.29. Pick-to: 6.5 6.6 6.7 Change-Id: I6067bb719b7d35aa2464a91ed198399ff9b1c9af Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Consider INSTALL_LIBDIR when calculating various cmake pathsAlexey Edelev2024-03-273-19/+79
| | | | | | | Task-number: QTBUG-123039 Change-Id: I111cd612afe64a4f8456ab05d6ff3caf828c4712 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* configure: Fix -system-zlib and -system-sqlite optionsJoerg Bornemann2024-03-271-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These options are declared with TYPE enum and a MAPPING that's supposed to control the feature 'system-zlib' or 'system-sqlite'. Since only inputs of type boolean control features now, we need to somehow declare that this non-boolean input controls a feature. We do this by adding the keyword CONTROLS_FEATURE to qt_commandline_option. For example, qt_commandline_option(zlib CONTROLS_FEATURE TYPE enum NAME system-zlib MAPPING system yes qt no ) declares - commandline option "zlib" sets the input "system-zlib", because of the "NAME system-zlib" argument - accepted input values are "system" and "qt", because we have "TYPE enum" and the odd values of MAPPING - those values are translated to yes/no, because of the even values of MAPPING - CONTROLS_FEATURE forces the translated input's type to boolean, and with that it will set the corresponding feature 'system-zlib' Luckily, only qtbase has command line options with MAPPING declared. Change-Id: I82d06cec43ece3b002c8f5dd414c68dc730909af Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* configure: Fix -c++std and -sanitize optionsJoerg Bornemann2024-03-271-1/+21
| | | | | | | | | | | | | | | | | This amends commit 110f656da9e9b2511c89679e79b197a3e7b07393. Command line options with a TYPE that denotes a custom command line argument handler cannot set a feature "foo" anymore by just setting INPUT_foo to "yes". Instead, they must use the newly introduced functions qtConfCommandlineEnableFeature and qtConfCommandlineDisableFeature. These functions will set INPUT_foo and augment the input with the information "this input is of boolean type". This information is used when deciding whether to use this input as feature switch. Change-Id: I83c691cc57424159148f059c2a1c8cd72e39ee63 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Move QtInstallPaths.cmake to the Qt6 packageAlexey Edelev2024-03-223-0/+35
| | | | | | | QtInstallPaths needs to be loaded at early stages Change-Id: Ie275ad2a8855b7555b110c35814ebadafe1817c6 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake/ELF: allow using Qt's full version number in the private tagsThiago Macieira2024-03-211-1/+5
| | | | | | | | | | | | | | | | | | | | We added the feature to tag private symbols using the Qt major version only, because us developers often move between versions and need to keep compiled code working, even when using private API (we're supposed to know what we're doing). Linux distributions, however, want to be told that something used private API and therefore needs to be rebuilt. See [1][2][3]. Distributors will learn about this feature when updating Qt causes the existing patch to fail to apply. [1] https://build.opensuse.org/projects/openSUSE:Factory/packages/qt6-base/files/0001-Tell-the-truth-about-private-API.patch?expand=1 [2] https://src.fedoraproject.org/rpms/qt6-qtbase/blob/rawhide/f/qtbase-tell-the-truth-about-private-API.patch [3] https://github.com/clearlinux-pkgs/qtbase/blob/main/tell-the-truth-about-private-api.patch Pick-to: 6.7 Change-Id: I5f663c2f9f4149af84fefffd17bed69026f4038d Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* CMake: Reconfigure whenever module EXTRA_FILES are touchedAlexandru Croitor2024-03-221-0/+3
| | | | | | | | | Otherwise the touched files will not be re-copied and re-installed until an explicit rerun of cmake. Pick-to: 6.7 Change-Id: I5abb752b45d8b33885a59363fe987225a89e713a Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Set the missing _qt_is_versionless_target property for versionless targetsAlexey Edelev2024-03-212-9/+2
| | | | | | | | | | | Remove the versionless targets handling from pri helpers. This logic is not relevant anymore since versionless targets hold all the related properties now. Amends 173164cd477211e574c0d04abef51aa0f4c3f78d Change-Id: I933bf7409a3668333929387b8232d002ab6fa66b Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Set the _qt_ module properties for interface targetsAlexey Edelev2024-03-211-0/+12
| | | | | | | | | | | | | The module properties starting with _qt can be set on interface targets. We should set them to handle _qt_config_module_name property for Private targets correctly. Otherwise private imported modules do not land in .pri files as dependencies. Amends 173164cd477211e574c0d04abef51aa0f4c3f78d Fixes: QTBUG-123410 Change-Id: I14866eb407e6ddcbd625f5546cba22ccc7b6a297 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Allow filtering modules that will use pre-built toolsAlexey Edelev2024-03-201-0/+9
| | | | | | | | | | | Add the support for QT_INTERNAL_FORCE_FIND_HOST_TOOLS_MODULE_LIST argument which allows to set the list of tool targets that should not build their tools if QT_FORCE_FIND_TOOLS is set to ON. This mechanism doesn't work when crosscompiling. Change-Id: I597ed766cc741cacf9cb73dd8dd255644c4c9e66 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Allow configuring a minimal subset of examples to deployAlexandru Croitor2024-03-192-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | When building examples as part of Qt in the CI, it's best to skip running deployment for all examples to save resources (space and time). Add a QT_DEPLOY_MINIMAL_EXAMPLES option similar to our QT_BUILD_MINIMAL_STATIC_TESTS option, which will set QT_INTERNAL_SKIP_DEPLOYMENT at the root examples directory scope, to skip deployment for all examples. Each example can then opt into the minimal subset by unsetting the QT_INTERNAL_SKIP_DEPLOYMENT variable before its qt_internal_add_example call. Add Coin instructions to enable this option when building our examples in the CI. Pick-to: 6.7 Task-number: QTBUG-90820 Task-number: QTBUG-96232 Task-number: QTBUG-102057 Change-Id: I2efcda455b400c27fe1efd1bcf81b133137fa2d1 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* CMake: Recompute QT_DEPLOY_PREFIX for each built exampleAlexandru Croitor2024-03-191-0/+2
| | | | | | | | | | | | | | | | | | | The current deployment api implementation sets the value of QT_DEPLOY_PREFIX based on CMAKE_INSTALL_PREFIX, if no QT_DEPLOY_PREFIX was previously specified. This does not work properly when multiple examples are placed in the same subdirectory and are using deployment api. Make sure to unset the QT_DEPLOY_PREFIX for each qt_internal_add_example call, so that a correct prefix is computed for each example, based on the modified CMAKE_INSTALL_PREFIX value that we set for each example. Pick-to: 6.7 Task-number: QTBUG-102057 Change-Id: I931e5f2d683ab94a940e20a2bdfeaa4ac5d8c5f8 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Fix finding standalone parts config file for yoctoAlexandru Croitor2024-03-191-1/+9
| | | | | | | | | | | | | | | | | | | | When building standalone tests of qtsvg targeting yocto, the standalone parts config file was not found. That's because it specifies a new CMAKE_STAGING_PREFIX for each built repo, and the QtSvgTestsConfig.cmake file will be located there, rather than in QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX, where the QtBuildInternalsConfig.cmake file is. So in this case, we always have to prefer looking into CMAKE_STAGING_PREFIX for the file. Amends 62905163bf887c2c2c9ba7edcd64c96d237a6e95 Task-number: QTBUG-90820 Task-number: QTBUG-96232 Change-Id: I8902381afa4267e40dfb2ad47e44285a806a35e2 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* cmake: Merge Apple platform auto-detect functionsTor Arne Vestbø2024-03-191-56/+50
| | | | | | | | | Makes it easier to see the interaction between the different parts, and extract some of them to apply to a wider set of platforms later on. Change-Id: I3dd71dd6ad7a5b2870ab60bfbe4cf31be418bd8a Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add hardening build optionsGiuseppe D'Angelo2024-03-192-7/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit enables hardened-specific checks and codegen, inspired by GCC 14's -fhardened command line switch and LLVM/libc++'s hardened modes. We enable (depending on compiler capabilities): * -ftrivial-auto-var-init=pattern; * -fstack-protector-strong; * -fstack-clash-protection; * -fcf-protection=full or /CETCOMPAT; * -D_FORTIFY_SOURCE=3 or 2 on Glibc, depending on the Glibc version, provided that some optimization level is enabled (release build or optimized debug build); * on libstdc++, -D_GLIBCXX_ASSERTIONS; * on libc++, -D_LIBCPP_HARDENING_MODE set to _LIBCPP_HARDENING_MODE_EXTENSIVE in debug and to _LIBCPP_HARDENING_MODE_FAST in release (_DEBUG is too slow); * -Wl,-z,relro,-z,now. This aligns us 100% with -fhardened (we already pass -fPIE and -pie anyhow). Some Linux distributions already ship GCC/Clang with some of these options enabled by default. The check for Intel CET has been amended to always test if the compiler supports the corresponding flag; and, if so, enable the feature. Before, it was behind a configure option and the test only checked if the compiler had CET support automatically active (the test didn't pass -fcf-protection to the compiler). The check for -fstack-protector-strong has been made general (rather than QNX-specific). We don't support QNX < 7 anyhow. Finally, the qt_config_linker_supports_flag_test test has been amended to also support MSVC. All of the hardening options are enabled by default. [ChangeLog][Build System] Qt builds by default in "hardened mode", meaning that a series of security-related compiler options are automatically enabled. In the unlikely case in which these options constitute an unacceptable performance hit, it is possible to disable individual hardening options when configuring Qt. Change-Id: I2c026b0438010ad10d5e7b1136fedf4ae3af8822 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* cmake: Override generator for iOS projects to Xcode in qt-cmake.inAlexandru Croitor2024-03-181-4/+13
| | | | | | | | Instead of maintaining a separate qt-cmake.ios.in wrapper script that can easily diverge from qt-cmake.in Change-Id: I53f4eac02188be89a4c11b3e71cde04ac2a24b51 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* cmake: Move iOS detection into qt_auto_detect_iosTor Arne Vestbø2024-03-182-6/+5
| | | | | | | | | | We don't need to deal with the input arguments to configure. We can instead look at QT_QMAKE_TARGET_MKSPEC, like we do when we auto detect other platforms. This handles both the -xplatform and the -platform arguments. Change-Id: I8d987d23e16bfa106833d521f67e8b5a931d9169 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* cmake: Don't set CMAKE_SYSTEM_NAME=iOS when configuring with -sdkTor Arne Vestbø2024-03-181-1/+1
| | | | | | | | | | | | | | The -sdk argument is documented as: Build Qt using Apple provided SDK <sdk>. The argument should be one of the available SDKs as listed by 'xcodebuild -showsdks'. [ChangeLog][configure] The -sdk argument no longer auto-enables the macx-ios-clang makespec. Pass -xplatform macx-ios-clang to explicitly build Qt for iOS. Change-Id: Ia4074015aba2c8296a65534c38eb2f06db32f286 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* cmake: Rename QT_UIKIT_SDK to QT_APPLE_SDKTor Arne Vestbø2024-03-189-27/+32
| | | | | | | | | | | | | | The SDK is relevant for all Apple systems, including macOS, iOS, tvOS, watchOS, and visionOS. We still pick up -DQT_UIKIT_SDK for iOS for compatibility. [ChangeLog][CMake] The -sdk configure argument now maps to the QT_APPLE_SDK CMake variable. QT_UIKIT_SDK is still supported for iOS builds for compatibility. Change-Id: I983a2f23c2414eb73cd35bb83738088defb45cbd Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* cmake: Propagate Apple platform build requirements to qconfig.priTor Arne Vestbø2024-03-141-2/+17
| | | | | | | | | | | | So we don't have to maintain the requirements in two places. None of the variables removed from the qmake configs are referenced before we do load(qt_config), so this should be safe. Pick-to: 6.7 Change-Id: Iabd5884a2fd1c4b1cd7b44416bebb2624050229e Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* coin: Add instructions to build standalone examplesAlexandru Croitor2024-03-141-0/+7
| | | | | | | | | | | | | | | | | | | | | If a qt5.git configuration is marked with the StandaloneTests feature, tell CMake not to build the examples in-tree, and instead use qt-internal-configure-examples to build the examples out-of-tree. This brings a couple of improvements: - higher chance of building examples as ExternalProjects without issues - ability to use deployment api in examples, without installing the examples into a main install prefix The new coin instructions files use a copy of the standalone tests instructions as a base. Task-number: QTBUG-90820 Task-number: QTBUG-96232 Change-Id: If89e6da0b327a38b9c2738f58aa1b5b5fb9fda37 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* CMake: Allow building all examples as standalone just like testsAlexandru Croitor2024-03-1412-96/+221
| | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce a new libexec/qt-internal-configure-examples script that allows to configure and build "standalone examples" just like "standalone tests". This is a prerequisite for using deployment api in examples for prefix builds, otherwise deployment api gets confused not finding various information that it expects from an installed qt. Because the various conditions in the build system for standalone examples are similar to standalone tests, introduce a new QT_BUILD_STANDALONE_PARTS variable and use that in the conditions. The variable should not be set by the user, and is instead set by the build system whenever QT_BUILD_STANDALONE_TESTS/EXAMPLES is set. Unfortunately due to no common file being available before the first project() call, in qtbase builds, per-repo builds and top-level builds, we need to duplicate the code for setting QT_BUILD_STANDALONE_PARTS for all three cases. Task-number: QTBUG-90820 Task-number: QTBUG-96232 Change-Id: Ia40d03a0e8f5142abe5c7cd4ff3000df4a5f7a8a Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* CMake: Move most of CMakeLists.txt into QtBaseHelpers.cmakeAlexandru Croitor2024-03-141-0/+206
| | | | | | Pick-to: 6.7 Change-Id: I19761dbeebdd2529ef0c493a9a61a1c6fe58667b Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Fix the condition for creating of the plugin init target aliasesAlexey Edelev2024-03-131-1/+1
| | | | | | | | | | | | Make sure that plugin_init_target is not empty. It's empty when creating qml plugins. Amends 566b726b8400d473861a62b4b9de87d1f0958d6d Pick-to: 6.7 Change-Id: If23998d50d8d31e20b3966730afb8b4b46b9990c Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Collect CMAKE_MODULE_PATH from QT_ADDITIONAL_PACKAGES_PREFIX_PATHAlexey Edelev2024-03-132-0/+18
| | | | | | | | | | | | | | | This is sensitive for the 'include' calls that expect cmake scripts to be found in some staging prefixes. In yocto QT_ADDITIONAL_PACKAGES_PREFIX_PATH points to the package image path(installation snapshot). If repo provides bundled 3rdparties the 'include' statement that includes 'FindWrap<3rdparty>ConfigExtra' is unnable to locate it, since it's expected to be found in Qt installation, but the file didn't land there at ptest stage. Fixes: QTBUG-122205 Pick-to: 6.5 6.6 6.7 Change-Id: Idd03f44efd2e3fdaa476873068c73ac28cd0a7b5 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* QT_NO_AS_CONST: rename and add docsGiuseppe D'Angelo2024-03-131-1/+1
| | | | | | | | | | Give it a name in line with the function name: qAsConst -> QT_NO_QASCONST, as already done for qExchange. We can do this because we never documented the macro itself. So, while at it: also document the macro. Change-Id: I6eb0834df438e4f4e818ef2cf8e702ed156dc253 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* CMake: Create alias targets for plugin init targetsAlexandru Croitor2024-03-121-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | When building tests in-tree targeting iOS, we run _qt_internal_finalize_executable via qt_internal_add_test_finalizers. This in turn calls __qt_internal_apply_plugin_imports_finalizer_mode which tries to link to versioned plugin int targets. Because the linked plugin init target is built in-tree as well, and did not have versioned alias targets created, configuration fails with: Target "tst_baseline_qsvgrenderer" links to: Qt6::QSvgIconPlugin_init but the target was not found. Make sure to create versioned alias targets for the plugin init targets. Amends 6c9f4f5ebcd35dc1a68c442d9fbf3ec48f30baca Pick-to: 6.7 Fixes: QTBUG-123186 Task-number: QTBUG-122181 Change-Id: I0048b724d465dc3c176d238d144feb072262d76e Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* "Simplify" versionless targetsAlexey Edelev2024-03-1212-25/+240
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Versionless targets in Qt6 are interface libraries that link the versioned libraries using the INTERFACE link type. This makes the linking chain more complicated than it can be. Also we miss some significant interface properties in the versionless targets comparing to the versioned targets. The new approach manually generates the versionless targets, instead of using CMake exports. For CMake versions < 3.18 we now create a copy of the versioned targets. The copy includes all the relevant INTERFACE properties from the versioned targets and imported locations for all configs. For CMake versions >= 3.18 we now create the versionless target ALIASes which should behave give the transparent access to the versioned targets. Using the QT_USE_OLD_VERSION_LESS_TARGETS flag you may force the behavor of the CMake versions <= 3.18 The change is partial workaround for QTBUG-86533. Task-number: QTBUG-114706 Change-Id: Iafadf6154eb4912df0697648c031fcc1cbde04e0 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Add public helper _qt_internal_add_phony_targetJoerg Bornemann2024-03-121-0/+118
| | | | | | | | | | | | | | | | | | | This function can be used to create a custom target like update_translations or all_qmllint that should be excluded from build and be triggered by the user. The function works around certain peculiarities of the Visual Studio project generators that are described at length in QTBUG-115166 and associated patches. Follow-up patches in qttools and qtdeclarative will use this function and remove duplicated code. Task-number: QTBUG-115166 Task-number: QTBUG-118980 Change-Id: I87b89a658f35a5a09e3f7b04bdd5cae2166f8d62 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Correct license for qbatchedtestrunner.in.cpp fileLucie Gérard2024-03-121-1/+1
| | | | | | | | | | | | | | File is is part of the internal test infrastructure. According to QUIP-18 [1], all test files should be LicenseRef-Qt-Commercial OR GPL-3.0-only [1]: https://contribute.qt-project.org/quips/18 Pick-to: 6.7 Task-number: QTBUG-121787 Change-Id: Ia5bc4e0abeea210ee501596330b2b63216e9e9c7 Reviewed-by: Kai Köhne <kai.koehne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>