summaryrefslogtreecommitdiffstats
path: root/cmake
Commit message (Collapse)AuthorAgeFilesLines
* Tune compilation flags to reduce libraries sizeAlexey Edelev2021-01-222-1/+15
| | | | | | | | | | | | 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>
* Fix static top-level buildJoerg Bornemann2021-01-221-7/+7
| | | | | | | | | | | | | | Commit d0071a4f871 broke static top-level builds: CMake Error at .../qtbase/lib/cmake/Qt6Gui/Qt6GuiPlugins.cmake:17 (set_property): set_property can not be used on an ALIAS target. Fixed by moving the un-aliasing of the target before the set_property call. Pick-to: 6.0 Change-Id: I96c731353798a58ff9b3a664f3614ef03c897dcb Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Only generate and add static plugin imports once per module targetCraig Scott2021-01-211-2/+18
| | | | | | | | | | | | | | | | | | | Projects may call find_package(Qt6 ...) multiple times. When enabling examples and tests, this happens a lot. For a statically built Qt, for modules that have plugins (e.g. Gui), every time the module's config file was loaded, it was generating and adding another copy of the import plugin sources to the module target. These accumulated and created many duplicates, which in turn blew out generation time and made the build very inefficient. This change checks whether the import plugin sources have already been processed for the module target and ensures they are only added once. It records its status on the target itself so that both local and global targets are supported. Fixes: QTBUG-90465 Change-Id: I1f45b1ee771a933ee755d44f1e983d6d9113dad0 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Do not export the QT_PLUGINS target property of Qt modulesJoerg Bornemann2021-01-202-3/+2
| | | | | | | | | | | This property is dynamically determined and set in the Qt6${module-name}PluginsConfig.cmake files now. There is no need anymore to export this property. Change-Id: I2d164864c4099034b88f9ad852eae8b9f9e55f8b Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Fix loading of Qt6*Plugin.cmake files of per-repo buildsJoerg Bornemann2021-01-202-10/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When doing a per-repository build of Qt, as it is done for the installer packages, the build of qtbase has no knowledge of plugins that might be built and installed from other repositories. That means we must not write a fixed list of known plugins when exporting Qt modules of qtbase. In particular, qtsvg adds imageformat plugins that are supposed to be picked up by qtbase's QtGui module when linking a project against a statically linked Qt. ${install-prefix}/lib/cmake/Qt6Gui/Qt6GuiPlugins.cmake missed the include statements for qtsvg's plugin config files and operated on a fixed list of plugins, all from qtbase. Apart from that, the Qt6::Gui target's property QT_PLUGINS did only contain the qtbase plugins. This patch fixes the situation in the following way: 1. All Qt6*PluginConfig.cmake files in ${install-prefix}/lib/cmake/Qt6Gui are detected and included. 2. From those file names, the target names of the plugins are deduced. This is safe as the file name of those generated files is a direct result of the plugin's target name. 3. The QT_PLUGINS property of the module is updated with the detected plugin target names. Fixes: QTBUG-89643 Change-Id: Ifc3c39aa9948277ead5ebb209ec5eff64746308b Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Add arguments to 'qt_manual_moc' to resolve 'moc' includesAlexey Edelev2021-01-201-1/+19
| | | | | | | | | | | | | | 'qt_manual_moc' doesn't provide include paths for 'moc' command to substitute required macros. This change adds the 'INCLUDE_DIRECTORIES' and 'INCLUDE_DIRECTORY_TARGETS' arguments to the 'qt_manual_moc' function. If 'INCLUDE_DIRECTORY_TARGETS' is specified, 'qt_manual_moc' collects 'INTERFACE_INCLUDE_DIRECTORIES' of provided targets and uses them as the 'moc' include directories. Change-Id: I58c8887dae3ca2484574c5e12e2cbd47f5bd3648 Reviewed-by: Craig Scott <craig.scott@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* CMake: Use private headers for internal module priJaeyoon Jung2021-01-201-0/+2
| | | | | | | | | | | | Just like config_module_name is appended by "_private" in the case of internal module pri, replace module_includes with the private one. It fixes the issue where a pro file that uses an internal module pri does not build due to missing paths to private headers. Fixes: QTBUG-89961 Change-Id: Ice16a1e9f709d29454f1ddf5b954673cc06a88bb Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Jaeyoon Jung <jaeyoon.jung@lge.com>
* cmake: Bail out in case syncqt failed to runKevin Funk2021-01-201-1/+4
| | | | | | | | | | | | | | Make sure to react on failed syncqt runs during the CMake run. CMake will now report something along this: ``` syncqt couldn't parse .../qt5/qtbase/sync.profile: Can't modify modulus (%) in scalar assignment at .../qt5/qtbase/sync.profile line 25, near ");" CMake Error at qtbase/cmake/QtModuleHelpers.cmake:192 (message): Failed to run syncqt, return code: 255 ``` Change-Id: I575a5fc926c547b6b633583e5d675f7e35beb734 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Fix framework path for *_header_check targetsJoerg Bornemann2021-01-191-1/+1
| | | | | | | | | | | | | | | | | | | When building a Qt module against an installer-provided Qt on macOS, the module pulls in the headersclean feature that creates the *_header_check targets. Those targets try to compile the public headers of the module, and the compilation command contains the -iframework argument. That -iframework argument is supposed to point to the directory where the Qt libs are installed. However, it pointed to the original CMAKE_INSTALL_PREFIX of the machine where Qt was packaged. Use the QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX variable instead that contains the real installation location, even for an installer-provided Qt. Pick-to: 6.0 Fixes: QTBUG-90402 Change-Id: I27de8b3cc816488c2716042383b334d5c421452d Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Move UNICODE and _UNICODE definitions to internal platform targetAlexey Edelev2021-01-192-1/+5
| | | | | | | | | | 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>
* Adjust database packages FindFoo.cmake files to CMake conventionAlexey Edelev2021-01-193-36/+41
| | | | | | | | | | | Replace package _LIBRARIES by _LIBRARY and _INCLUDE_DIRS by _INCLUDE_DIR. Move find_package_handle_standard_args for Oracle and DB2, since this call should set _FOUND variable but not separate condition. Fixes: QTBUG-89866 Change-Id: I54be2c2c4d7ba4b849a27139702861ecd937c444 Reviewed-by: Craig Scott <craig.scott@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* QtEntryPoint: Fix linking Release against RelWithDebInfo with MSVCJoerg Bornemann2021-01-181-5/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | To be able to link a Release user project against a RelWithDebInfo Qt we set several IMPORTED_*_RELEASE properties in the *AdditionalTargetInfo.cmake file of each Qt module. The EntryPoint module however is a bit special as it is an INTERFACE_LIBRARY linking publicly against a static library (EntryPointimplementation). Its *AdditionalTargetInfo.cmake file was almost empty, because qt_internal_export_additional_targets_file was called before EntryPointImplementation was set up. Also, qt_internal_add_module, which calls qt_internal_export_additional_targets_file, does not know that we want to export the EntryPointImplementation target. We fix this by telling qt_internal_add_module(EntryPoint) to not generate the *AdditionalTargetInfo.cmake file and call qt_internal_export_additional_targets_file later to take the targets EntryPoint and EntryPointImplementation into consideration. qt_internal_add_module learned the option NO_ADDITIONAL_TARGET_INFO to turn off the generation of *AdditionalTargetInfo.cmake files. Pick-to: 6.0 Fixes: QTBUG-90039 Change-Id: I68ec7125b538a57567035e7adb8dac3b213f95e6 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* FindLibb2: Don't rely solely on pkg-configCraig Scott2021-01-181-3/+33
| | | | | | Task-number: QTBUG-86283 Change-Id: Ie455d7cfc6e6f9ae8297f8bc0daf2816ccce91b6 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Make -pkg-config configure option actually workCraig Scott2021-01-181-0/+6
| | | | | | | | | | | The QtBuildInternals config package file gets processed before feature evaluation occurs. That means INPUT_pkg_config may be defined, but the corresponding FEATURE_pkg_config variable won't have been set/updated yet. Do this check locally because the availability of a number of features is conditional on whether pkg-config is available. Change-Id: I6030eb380ee0c630ffbe5db5eed397a46227c7f6 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Fix missed feature evaluation errors in reportAlexey Edelev2021-01-152-4/+10
| | | | | | | | | | | | Add an optional argument to store the report command while feature evaluation-only stage. This is necessary, because according to the actual feature evaluation process, evaluation happens only once and it's impossible to record any command during the evaluation-only stage. Fixes: QTBUG-90319 Change-Id: I215fbe0a28a2661cd2d97d253b2e2c787d295cbd Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Jason McDonald <macadder1@gmail.com>
* CMake: add CoreLocation framework for macOSIvan Solovev2021-01-151-0/+1
| | | | | | Task-number: QTBUG-89854 Change-Id: Icd52a6dd0ae36ae91599ab9a583e6920f2d2ba4c Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Prevent compiler and linker flags from growing every cmake runCraig Scott2021-01-151-157/+182
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Functions in QtFlagHandlingHelpers.cmake try to update the CMake cache variables for compiler and linker flags. These were using the current value of those variables and writing the modified ones back to the cache every time CMake ran. If a toolchain file sets or modifies any of these variables, that updated value is used and written back into the cache instead of the original cache variable's value. The next time CMake executes, the toolchain file re-applies the same change and the variable grows longer each time with flags repeated. With Ninja, this causes a complete rebuild every time CMake is re-run. The Android NDK toolchain file is one example where this behavior is triggered (the fault is shared, one could argue that the NDK should only be setting ..._INIT variables, but that's out of our control). Another related bug in the previous implementation was that the flags used to build after the first CMake execution could be different to those used for all builds after the second and later CMake runs. This is because the CMake cache was being updated, but not always the calling scope of the functions that modified them. If a toolchain file set any of the compiler or linker flag variables as non-cache variables, then updating the cache variable would have no effect on the calling scope. The non-cache variable would continue to take precedence for that scope for that run. The next time CMake executes though, the updated cache variable would now have been used by the toolchain file and the change *will* be part of the non-cache variable's value. The above are examples of why you should try to avoid updating these cache variables from project code. We could leave the cache alone and always update only non-cache variables, but then a developer looking at the cache may wonder why the values they see there don't match the values being used in builds. Or worse, they think the cache values are being used and don't realize the builds are using something different. Ultimately, we have to choose which downside we are happy to live with. The changes here preserve the previous intent of updating the cache, but it's still a bit fragile. Fixes: QTBUG-89821 Task-number: QTBUG-85992 Task-number: QTBUG-86866 Change-Id: I8a16753e159bde338e6d2e5dd2ce91fc8ac5c39d Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Lower the CMake minimum required version for single-config buildsJoerg Bornemann2021-01-141-0/+10
| | | | | | | | | | | | | | | | | | | | Ubuntu 20.04 is a supported platform and comes with CMake 3.16. The current state of the Qt build works fine with this CMake version, mainly because the default build on Linux is single-config. For multi-config builds we have higher version requirements as documented in cmake/README.md. This lowers the barrier for users using single-config builds who don't want or cannot upgrade to CMake >= 3.18. For Ninja Multi-Config builds, which were introduced by CMake 3.17, we yield a warning that 3.18.3 is the lowest supported version. Pick-to: 6.0 Change-Id: Ia918b9f2b494508e86301ffc0e138d3ad4dbaf86 Reviewed-by: Craig Scott <craig.scott@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* CMake: Use -ffat-lto-objects for static libraries with ltcg and GCCChristophe Giboudeaux2021-01-131-0/+8
| | | | | | | | | | | | | | CMake <= 3.19 adds the '-fno-fat-lto-objects' compiler flag unconditionally when CMAKE_INTERPROCEDURAL_OPTIMIZATION is enabled. This is fine for shared libraries but static ones need the opposite compiler flag. Task-number: QTBUG-89426 Pick-to: 6.0 Change-Id: Ie5f48178803a270f6d94408f7a8e85d379eb123c Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix warning in generated test wrappersAlexey Edelev2021-01-131-1/+2
| | | | | | | | | | | | | Since test command variable may contain quotes, there is a warning in generated test wrappers related to 'message(FATAL_ERROR', that should display full command in log in case of error. To avoid any complicated quoting of command to only display it, join command into single string in wrapper script and pass resulting variable to 'message(FATAL_ERROR'. Pick-to: 6.0 Change-Id: Ie990fc0b0bf2c19b119c7c4e2aeec092e5200103 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: improve FindMySQL.cmakeLi Xinwei2021-01-091-10/+9
| | | | | | | | | | | | | | | On Windows, Qt should libmysql.lib instead of mysqlclient.lib. Add support for mariadb. Re-indent FindMySQL.cmake. Fixes: QTBUG-88661 Fixes: QTBUG-89775 Pick-to: 6.0 Change-Id: I6bdf195b8976c59230a12af335a838af55df0caf Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Remove redundant .qch from installed docsAlexey Edelev2021-01-081-1/+3
| | | | | | | | | | Use upper-level document build directory for generated .qch files. This avoids copying of .qch with html documents and duplicating them in the installation directory. Pick-to: 6.0 Change-Id: I63b2de0047005419d352ea259dec6f17a826a477 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Add newline to the end of the config.summaryAlexey Edelev2021-01-081-0/+1
| | | | | | | | Amends 94b6bec01f250065b28d5528ea9239bafd5253e5 Pick-to: 6.0 Change-Id: I0d4be9c7f9aff071468a66d7940d6cd2488136ca Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Fix qch install pathAlexey Edelev2021-01-071-1/+1
| | | | | | | | | Exclude qch_file_name from install DESTINATION Fixes: QTBUG-89769 Pick-to: 6.0 Change-Id: I8dba13a0a2c2c92d6b2d6aa438c295b42a04156b Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Add 'oci' to possible Oracle Client library namesAlexey Edelev2021-01-061-1/+1
| | | | | | | | In latest Oracle Instant Client releases for windows the OCI library name is 'oci.dll'. Add it as option to find_library call. Change-Id: I6e6f4a998207d16583a380c1bd95db857051606b Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Add proactive check of generator multi-config capabilitiesAlexey Edelev2021-01-051-0/+10
| | | | | | | | | | Add explicit error, if multi-config build is requested, but selected generator doesn't support it. Fixes: QTBUG-88287 Pick-to: 6.0 Change-Id: I6dba589bb59ad69fa07221c657df272ec75c359b Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Fix missing report entriesAlexey Edelev2021-01-051-2/+2
| | | | | | | | | | Increment command_count correct way. Fixes: QTBUG-88054 Pick-to: 6.0 Change-Id: I0769814ed75ee12db1cab3b1f85635b4d7ee0605 Reviewed-by: Craig Scott <craig.scott@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Print feature condition errors in configure reportAlexey Edelev2021-01-052-2/+7
| | | | | | | | | | | Add output of feature condition error at the end of configuration summary. Introduce qt_configure_add_report_error that may be used to add error to end-point configure report without actual configure interruption. Fixes: QTBUG-88282 Change-Id: Idcf478da863ae6507438eb3370927d7d1f01e071 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Fix dirty summary file when reconfigure qtAlexey Edelev2020-12-301-1/+2
| | | | | | | | | | | Overwrite summary file during each configuration cycle. Amends 6baf36d77432dc56a47e50f59ccde93b73cfe204 Fixes: QTBUG-87830 Pick-to: 6.0 Change-Id: Ie77f9aded4a7395592ff3cefad02265d836bebcc Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Revert "CMake: Fix missing report entries"Alexey Edelev2020-12-301-2/+1
| | | | | | | | | | This reverts commit 642ee46f98c6b3cd98a323f7dc5cac3a738b066c. Reason for revert: Issue when command_count is actually 0 Pick-to: 6.0 Change-Id: I1b2603f25b56e3bd50cfc22a08925930ad231498 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* CMake: Fix missing report entriesAlexey Edelev2020-12-291-1/+2
| | | | | | | | | | Use LESS_EQUAL condition since qt_configure_command_count stores last added command index but not actual count Fixes: QTBUG-88054 Pick-to: 6.0 Change-Id: I8112820f9885bdad5a786a4f6b4890d8f2fbe14b Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* CMake: Store config summary to fileAlexey Edelev2020-12-291-0/+5
| | | | | | | | | Add generation of qmake-like config.summary in build folder Fixes: QTBUG-87830 Pick-to: 6.0 Change-Id: I08dd9b3116c6200f7e9f5de96605118c1ea474ad Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Fix the CMake feature for docker-testserver to use correct mkspecs pathSona Kurazyan2020-12-231-1/+1
| | | | | | | | | | | Use the QT_MKSPECS_DIR instead of QT_SOURCE_TREE to find out the location for the testserver feature's data. QT_SOURCE_TREE points to qtbase source location, which may not be always available. This allows to use this feature by projects outside of qtbase. Task-number: QTBUG-85034 Change-Id: If7fa6ef95777be9acf35d36f8d99776bf9568a79 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Allow other projects to use the CMake feature for docker-based testsSona Kurazyan2020-12-221-1/+5
| | | | | | | | | | | Introduce a new QT_TESTSERVER_COMPOSE_FILE variable for setting a custom docker compose file path, which can be set by projects outside of qtbase (e.g. QtCoap). If the variable is not set, fallback to the compose file located in qtbase. Task-number: QTBUG-85034 Change-Id: I4c0c9b161cad9787b089ef7e9da2aa00352a9159 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* 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>
* CMake: Use Release build type by defaultAlexey Edelev2020-12-211-7/+7
| | | | | | | | | | | Use developer-build feature to set Debug build by default instead of .git folder detection Task-number: QTBUG-89410 Fixes: QTBUG-89476 Pick-to: 6.0 Change-Id: I2a4f529299d4875e7b0eef5b41dd7a6b9402178b Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Use host variables instead of hardcoded directoriesAlexey Edelev2020-12-217-12/+23
| | | | | | | | | | | | | | | | | | | 'QT_HOST_PATH' indicates that we use crosscompilation toolchain to build project. In this case 'Qt6Config.cmake' loads 'Qt6HostInfoConfig.cmake' from host QT_HOST_PATH, that defines correct paths to host tools. Replace hardcoded paths for host tools by paths recorded in Qt6HostInfoConfig.cmake. Correct conditions for QT_HOST_PATH, evaluate it explicitly as string, but not as boolean expression. Fixes: QTBUG-86557 Pick-to: 6.0 Change-Id: Ib52bbd32478051d019a932dcb1f735e2d4aacfbf Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Fix glitch in module pri generation for Ninja Multi-ConfigJoerg Bornemann2020-12-211-0/+1
| | | | | | | | | | | | | With Ninja Multi-Config, QMAKE_LIBS_FOO_DEBUG and QMAKE_LIBS_FOO_RELEASE are generated, if their values differ. In that case we did not create an empty QMAKE_LIBS_FOO assignment. That, however, is needed to make the library 'foo' known to qmake_use.prf. This amends bd98ba0d17b7a7c14fefc1741e68e8ca945a6655. Fixes: QTBUG-89387 Change-Id: I80e23746e6ba6ff7f5f4186116232395814cee15 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* CMake: Add detection of FEATURE_foo change by userAlexey Edelev2020-12-173-32/+67
| | | | | | | | | | | | | | | | | | | | | Unset all QT_FEATURE_foo values for every build. If any of FEATURE_foo is different of QT_FEATURE_foo, mark whole Qt build as dirty. Reset FEATURE_foo for dirty builds to the calculated value if it doesn't meet its condition. Set Qt module as NOT FOUND if its target was not created during configuration. Main issue with this approach are generated files, that became trash once the related features are disabled. This especially affects features that enable/disable Qt modules. FooConfig.cmake files are created and generate lots of warnings if feature was disabled. We may introduce a module cleanup procedure at some point. Fixes: QTBUG-85962 Pick-to: 6.0 Change-Id: Id71c1edb4027b24c6793063e40cc9d612c24ebce Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Fix module separate build error when -DFEATURE_static_runtime=ONLi Xinwei2020-12-171-9/+9
| | | | | | | | | | | | | | | | | | Build qtbase with -DFEATURE_static_runtime=ON, and then separately build another module, following build error occurs: error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease'. That's because all the sources in this module are compiled with 'MD'. When separately building a module except qtbase, FEATURE_static_runtime is not exist in cmake cache. So we should use QT_FEATURE_static_runtime instead of FEATURE_static_runtime in qt_set_common_target_properties. Additionally, adjust the indentation. Pick-to: 6.0 Change-Id: I2cf4737db9d3e8533570039a66c7d277d62a8d14 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Fix compile warnings when MSVC and -DFEATURE_static_runtime=ONLi Xinwei2020-12-151-0/+2
| | | | | | | | | | | | | When using MSVC compiler and -DFEATURE_static_runtime=ON, qrc_foo.cpp and qtentrypoint_win.cpp are still compiled with '-MD' or '-MDd' flag, which will cause following warnings and other possible problems: warning LNK4098: defaultlib "MSVCRT" conflicts with use of other libs; use /NODEFAULTLIB:library Pick-to: 6.0 Change-Id: I6794930a64e9cff4dc1c9632fc3fc64227848af0 Reviewed-by: Yuhang Zhao <2546789017@qq.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Android: install android test scripts to libexec to test on all modulesAssam Boudjelthia2020-12-111-0/+9
| | | | | | | | | | | The scripts that are used by Android test VMs are now located in qtbase and are not easily usable by other modules. To fix that and allow other modules to use those scripts, we install them with cmake into libexec. Task-number: QTQAINFRA-4052 Pick-to: 6.0 Change-Id: Ibdd3658fd9fe7e007104a85d9999028a2de99a33 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Wrap benchmarks with cmake scriptAlexey Edelev2020-12-101-42/+57
| | | | | | | | | | | | | | | | | Wrap benchmark executable target with cmake script to run it on windows without necessity of environment variables set. Move common logic related to test and benchmark environment to 'qt_internal_collect_command_environment' function. Make error message of wrapper script a bit more verbose. Amends 61d5b019727dd1c06366205cb307a2a928a2a29c Task-number: QTBUG-89076 Pick-to: 6.0 Change-Id: I6ad3a027dc071176070cf3af4cf306f20d652039 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* CMake: Use test wrapper to run android testsAlexey Edelev2020-12-102-78/+168
| | | | | | | | | | | | | | | | | | | | Refactor test adding procedure. It's expected that for each new platform we prepare test executable and arguments first and then pass them to common test adding section. Rename '_qt_internal_wrap_test' to 'qt_internal_create_command_script' Rework paramerters handling of 'qt_internal_create_command_script', make them named. Add 'qt_internal_create_test_script' to add tests and wrap them using 'qt_internal_create_command_script'. Amends f19266bd02a01d4b7b277ea769c4c17727b1e661 Fixes: QTBUG-88053 Pick-to: 6.0 Change-Id: I812f4a295005bf3a85cdcb5b8c41180f8249dc96 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix autotest config in cross-compiled prefix buildEirik Aavitsland2020-12-081-1/+5
| | | | | | | | | | qt-cmake-standalone-test would be looking for the config files under the target machine install prefix instead of under the staging prefix on the build host. Change-Id: I29850af6d8fe502f4944f689ec10539d17ccdcb9 Pick-to: 6.0 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Improve tests wrapper arguments handlingAlexey Edelev2020-12-081-2/+15
| | | | | | | | | | | | Use 'separate_arguments' to explicitly split arguments from environment that form 'COMMAND' for execute_process. Enclose using bracket syntax arguments, that propagated to wrapper script as pure strings. Amends f19266bd02a01d4b7b277ea769c4c17727b1e661 Pick-to: 6.0 Change-Id: I858ddff7efa281f9cecfda656a02e1fd12361758 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Document some missing configure cmake mappingsLi Xinwei2020-12-081-5/+5
| | | | | | Pick-to: 6.0 Change-Id: I4b15dde581e28aece52d7f98cb3d94827e8bcc33 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Do not write Effective[Source]Paths to target_qt.confJoerg Bornemann2020-12-081-17/+0
| | | | | | | | | | This was needed, when the mkspecs directory was not present in the non-prefix build directory. That's not the case anymore. Pick-to: 6.0 Fixes: QTBUG-89182 Change-Id: I2b04c2d857b0af324e1d7c41ed1934a62275d6f1 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Disable static plugin imports for non-executable targetsAlexandru Croitor2020-12-083-1/+31
| | | | | | | | | | | | | | There is no point in generating cpp files containing Q_IMPORT_PLUGIN() macro calls for non-executable targets like modules, plugins and object libraries in a static Qt build. It causes unnecessary compiling of 10+ files for each of those targets. In a static Qt build, plugin imports should only be done for executables, tools and applications. Pick-to: 6.0 Change-Id: Ied90ef2f6d77a61a093d393cfdf94c400284c4f0 Reviewed-by: Craig Scott <craig.scott@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Offer to build manual tests through QT_BUILD_MANUAL_TESTSAleix Pol2020-12-082-2/+4
| | | | | | | | | Disabled by default as they are currently not being built and many are not working properly, this will allow us to start using them again. Change-Id: I823368d04e9fde2beccabedc3ca15efd1f355bfb Pick-to: 6.0 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>