summaryrefslogtreecommitdiffstats
path: root/cmake
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* wasm: don’t set exit_runtimeMorten Sørvig2021-06-231-1/+1
| | | | | | | | | | | | | | | | | | Go with Emscripten’s default of not shutting down on main() exit; this allows for writing main() in such a way that avoids the exec() workaround. Existing main() implementations (which do use the exec() workaround) do not shut down Qt cleanly anyway, so we gain little by shutting down the Emscripten runtime. Applications can set this flag if they do want to shut down on main() exit: LFAGS += -s EXIT_RUNTIME=1 Change-Id: I52e1cc2bc907d1d2146822713e39b7610db3f95b Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* 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>
* wasm: enable MODULARIZE option and set EXPORT_NAMEMorten Sørvig2021-06-221-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | Make Emscripten generate a global constructor function ("createQtAppInstance()") instead of a global javascript module object. This enables more fine-grained control over module instantiation; previously the module object would be created when the runtime javascript was evaluated, and the number of emscripten module/instances was limited to one per page. Set EXPORT_NAME to “createQtAppInstance” which avoids collisions with other non-Qt Emscripten modules on the same page. A further improvement would be to include the app name in EXPORT_NAME, but this is not done at this time. Update the code in qtloader.js to call the constructor function instead of working on a global module object. The qtloader.js API is functional before the wasm and Emscripten modules have been instantiated; store properties and forward to the Emscripten module when it's created. Change-Id: I12c49a5b9a4a932bbc46fcc5e5ecc453fd0fe7f0 Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* wasm: fix build for emscripten 2.0.14Lorn Potter2021-06-211-1/+1
| | | | | | | | new syntax rules for EXTRA_EXPORTED_RUNTIME_METHODS valid after 2.0.16 Pick-to: 6.2 Change-Id: Iff33e4c6f3176619fb35ec0994a7cc87b5d937c7 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Cleanup temporary code related to internal modulesAlexey Edelev2021-06-211-9/+1
| | | | | | | | | Remove the temprotary 'Private' targets of the iternal modules. Pick-to: 6.2 Task-number: QTBUG-87775 Change-Id: I9a2c7c8c2f63602476fd935b11dab7a835864537 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Update section on required CMake versionsAlexandru Croitor2021-06-211-1/+9
| | | | | | | Change-Id: I6c556cd3a2e8bdf87b3c7c6ef62a6af6bdbe7137 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Craig Scott <craig.scott@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Move dependency lookup functionality to the common macroAlexey Edelev2021-06-196-51/+35
| | | | | | | | | | Dependency lookup mechanism is the same for modules and plugins. It makes sense to wrap it using macro. Pick-to: 6.2 Change-Id: I73727743b0f5f40b2d94624f65ebfcf85e8dcc59 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Disable finalizers by default for the non-ld linkersAlexey Edelev2021-06-192-3/+19
| | | | | | | | | | Check if link order matters before use the object library finalizer. Amends 5fb99e3860eb43f4bacacec7f4a4626cb0159b14 Pick-to: 6.2 Change-Id: Ie996bc175ebea36ccda1bb2fe388ae3b7fcde395 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix the naming of the config header files for private modulesAlexey Edelev2021-06-181-4/+11
| | | | | | | | | | | | | | | | | Perform a file name of the config header before adding a '_private' suffix. TODO: It makes sense to revisit the use of the CONFIG_MODULE_NAME variable since the variable is used for different purposes and mutate with use. Amends 8aee7c6b29be5a0ee7d5e7cfcb5f2db762b2e28b Pick-to: 6.2 Fixes: QTBUG-94568 Change-Id: Id5aaf8d423ec8b94afffe4641b54dab94b5453fb Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Move the linking logic of the object libraries to a common functionAlexey Edelev2021-06-181-38/+40
| | | | | | | | | | | | | | | | | | | The linking logic of object libraries should be reusable outside of the resource context. This introduces a __qt_internal_propagate_object_library function that prepares all the necessary genexes to link and propagate the object library to the end-point executable. Rename resource object finalizer API to make the naming more generic to object libraries of any kind. Amends 5fb99e3860eb43f4bacacec7f4a4626cb0159b14 Pick-to: 6.2 Task-number: QTBUG-93002 Task-number: QTBUG-94528 Change-Id: I69d0f34c0dadbd67232de91035aaa53af93d1fa1 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: output VCPKG_CHAINLOAD_TOOLCHAIN_FILE with cmake pathsMårten Nordheim2021-06-181-0/+1
| | | | | | Change-Id: Ibde8890c30b9024aca589e892590d071b547c361 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Use target OUTPUT_NAME as a module identifier in .pri filesAlexey Edelev2021-06-181-3/+1
| | | | | | | | | | | | | | QtPriHelpers copies the logic related to the module OUTPUT_NAME to produce a module identifier. Since the module identifier should be equal to OUTPUT_NAME it makes sense to reuse the property and deduplicate logic. Amends 8aee7c6b29be5a0ee7d5e7cfcb5f2db762b2e28b Pick-to: 6.2 Fixes: QTBUG-94568 Change-Id: I8d9c04273e4cdb1a2e6a3b0db3ddf52e008c0cf7 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* 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>
* CMake: Handle OPTIONAL_COMPONENTS in qt_find_packageAlexandru Croitor2021-06-175-3/+37
| | | | | | | | | | | | | | | | | | The optional components arguments were not handled before which caused the recorded package information for static builds to be incorrect, it only recorded the package name without the component. Remove REQUIRED_COMPONENTS TODO, there is no such find_package option, it's already handled by the regular COMPONENTS code path. Amends 07b6d3367debd8f15974abf0f5cdf48f0fe3a536 Pick-to: 6.1 6.2 Fixes: QTBUG-94501 Change-Id: Ib48a7befcb70e20c3f21315897d51d3064b48134 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Dominik Holland <dominik.holland@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Fix internal module naming in qmake .pri filesAlexey Edelev2021-06-172-1/+3
| | | | | | | | | | | | | Set the correct value to the _qt_config_module_name property at the internal module creating step instead of appending _private suffix when generating .pri files. Amends 425ff34aa10a02524f2d52f544dc00b539ef9a26 Pick-to: 6.2 Fixes: QTBUG-94568 Change-Id: I6fa8089358bc638668e313c98c3aee680bf7ec2a Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Export info if an object lib target is a plugin initializerAlexandru Croitor2021-06-171-0/+5
| | | | | | | | | | | | Needed for qtdeclarative so we can filter out which object library should go into which export set, because qt_internal_add_qml_module can create both a backing library export set and a plugin export set. The plugin initializer object lib should go to the plugin export set. Pick-to: 6.2 Task-number: QTBUG-92933 Change-Id: I0fce131eff75a0b3090ac0fbb2a12ecfcba5e38d Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Add TODO to apply generalized object library linking approachAlexandru Croitor2021-06-171-0/+3
| | | | | | Pick-to: 6.2 Change-Id: I1ea368e81d8b055ef353a0f021f188b45588c937 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Set the plugin class name for qml pluginsAlexandru Croitor2021-06-171-2/+24
| | | | | | | | | | | | | | | | | | | | | | | | | This is needed for a change in qtdeclarative to allow building the Q_IMPORT_PLUGIN-containing object library initializer of a qml plugin. Show an error if the qml plugin has no class name, it's needed for plugin initialization so it's mandatory to have a class name. Show an error if a class name is not found when computing the import macro for a plugin (both for a regular qt plugin and a qml plugin). When querying for the class name of a target, query both a Qt6:: prefixed target as well as a non-prefixed one, with the Qt one taking precedence. This is to allow querying the class name of user project created qml plugins. Currently regular qt user plugins don't use the object library initializer approach. This will likely be revisited in the future. Pick-to: 6.2 Task-number: QTBUG-92933 Change-Id: I46417471a7d8b49651e6821f7b28e7a9d44c2557 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Don't generate .pri files for qml pluginsAlexandru Croitor2021-06-171-1/+5
| | | | | | | | | | | | | | | | | We didn't do it in Qt 5 times and it was accidentally done for Qt 6. There's no reason to generate them, the .pri files are only meant to be used for regular plugins so a project can do QTPLUGINS += foo. That mechanism is not needed for qml plugins which use qmlimportscanner instead. Furthermore the pri contents didn't contain a class name, so they couldn't be used anyway. Pick-to: 6.2 Change-Id: I6299fda21ece0f693a817ab558b45aa46b97e5ee Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Remove target specific flags from the linker capabilities checkAlexey Edelev2021-06-169-186/+20
| | | | | | | | | | | | | Remove target specific flags from static_link_order. Move the check to the common config.tests folder. Amends 5fb99e3860eb43f4bacacec7f4a4626cb0159b14 Pick-to: 6.2 Task-number: QTBUG-93002 Task-number: QTBUG-94528 Change-Id: I1368075ec6bd1e743b2b89fd93143df38a278ec2 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Don't make example external projects depend on testsAlexandru Croitor2021-06-161-2/+12
| | | | | | | | | | | | | | | | | | Only depend on the ${project}_src and ${project}_tools targets. This might exclude some non-obivous target dependencies, but we can adjust that if needed. This reduces the build.ninja file of qtbase + qtsvg form 341MB to 41MB when configuring with tests and examples, as well as reduces the processing time of calling ninja. Amends d97fd7af2bc5c89a0ad9e5fac080041b78d01179 Pick-to: 6.2 Change-Id: I2860d8ae89728f33f6b73fede1335cd6d6290f78 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Check the impact of static link order for user projectsAlexey Edelev2021-06-165-33/+122
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For user projects we run the static link order check once 'find_package(Qt6 ...)' is called. If linker can resolve circular dependencies between static libraries and object files we set the _qt_link_order_matters property of the Qt::Platform target. This indicates the use of finalizers is not required and we may rely on CMake-base propagation of resource libraries and resource object files. If linker could not resolve circular dependencies depending on the _qt_resource_objects_finalizer_mode value: - Finalizer will be called and collected resource objects will be linked to the target directly. - Finalizer will be omitted and resource objects will be linked using the target_sources function implicitly. This only propagates resource one level up if consumer links the static library PUBLICly, but all symbols will be resolved correctly since object files are placed in the beginning of the linker line. In the CMake version 3.21 we expect that CMake will take care about the order of the resource object files in a linker line, it's expected that all object files are located at the beginning of the linker line. TODO: Need to confirm that the CMake 3.21 meets the expectations. Amends 4e901a2f99cbfda3b479253ea54b16f02e1c3aa5 Pick-to: 6.2 Task-number: QTBUG-93002 Task-number: QTBUG-94528 Change-Id: Ia68976df8182d3d3007b90c475c1e3928a305339 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Promote all targets to global within a scope when possibleAlexandru Croitor2021-06-163-3/+39
| | | | | | | | | | | | | | | | | | | | | | | | CMake 3.21 introduced a new IMPORTED_TARGETS directory property which we can use to promote all imported targets within a scope to be global. This would cover transitive non-Qt imported targets which the Qt build system does not know about and is thus a more complete solution compared to promoting only Qt targets. Run a finalizer at the end of the directory scope where find_package(Qt6) is called to promote all imported targets within that scope to global (when requested). The old promotion method is disabled when the CMake version is new enough. Pick-to: 6.2 Task-number: QTBUG-92878 Task-number: QTBUG-94528 Change-Id: I533a3bd4186eba652f878ddd72c76118c2fd8bae Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Allow promoting the Qt libraries to be global targetsAlexandru Croitor2021-06-168-17/+154
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | User projects can set the QT_PROMOTE_TO_GLOBAL_TARGETS variable to true so that the various imported targets created by find_package(Qt6) are promoted to global targets. This would allow a project to find Qt packages in a subdirectory scope while using those Qt targets from a different scope. E.g. it fixes errors like CMake Error at CMakeLists.txt:5 (target_link_libraries): Error evaluating generator expression: $<TARGET_OBJECTS:Qt6::Widgets_resources_1> Objects of target "Qt6::Widgets_resources_1" referenced but no such target exists. when trying to use a static Qt from a sibling scope. Various 3rd party dependency targets (like Atomic or ZLIB) are not made global due to limitations in CMake, but as long as those targets are not mentioned directly, it shouldn't cause issues. The targets are made global in the generated QtFooAdditionalTargetInfo.cmake file. To ensure that resource object libraries promoted, the generation of the file has to be done at the end of the defining scope where qt_internal_export_additional_targets_file is called, which is achieved with a deferred finalizer. Replaced all occurrences of target promotion with a helper function which allows tracing of all promoted targets by specifying --log-level=debug to CMake. Pick-to: 6.2 Fixes: QTBUG-92878 Change-Id: Ic4ec03b0bc383d7e591a58c520c3974fbea746d2 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Detect win32-msvc targetAllan Sandfeld Jensen2021-06-151-0/+3
| | | | | | | | Automatically set compilers based on old mkspec style target Pick-to: 6.2 Change-Id: I80404376964a85c6b519657c054d008da47aed91 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Fix the win32-clang-msvc targetAllan Sandfeld Jensen2021-06-154-3/+10
| | | | | | | | Detect clang-cl mkspec target Pick-to: 6.2 Change-Id: If0ca31ae2da3b44a4e2bd116933007139cc02fdc Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Adjust the EntryPoint target name according to the internal module naming policyAlexey Edelev2021-06-152-9/+10
| | | | | | | Pick-to: 6.2 Task-number: QTBUG-87775 Change-Id: I1d6097c950f97e102c44e2952edc98caa4deb6c6 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Be precise about EXTERNAL_BUILD check when building examplesAlexandru Croitor2021-06-151-1/+3
| | | | | | | | | | | | | | | | This change allows temporarily removing the EXTERNAL_BUILD option in a qt repo examples project to check how the examples behave in a non-external project build, without forcing the developer to use a prefix build. Useful to compare behavior until we've ported over prefix builds to use EXTERNAL_BUILD. Amends d97fd7af2bc5c89a0ad9e5fac080041b78d01179 Change-Id: I29b834bb5f00e1e93966caae6f816faedba76b76 Reviewed-by: Craig Scott <craig.scott@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Add public FindPackageHelpersDominik Holland2021-06-145-4/+6
| | | | | | | | | This makes qt_internal_disable_find_package_global_promotion available, which is needed when linking against QtMultimedia in a static build Pick-to: 6.2 Change-Id: I9b8f6d7b74a8693ac471f8a280e893f4da80a44b Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* cmake: Allow tools to enable exceptionsRobert Griebl2021-06-141-1/+7
| | | | | | | | | | Needed for the QtApplicationManager tools. Pick-to: 6.2 Change-Id: I987b297406b6659d777ce5c00f9fc1b89ccc80ab Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Replace flags with spaces when removing themAlexey Edelev2021-06-121-2/+2
| | | | | | | | | | | Removing flags based on REGEX may include spaces, so flags might be glued. Replace flags with spaces to keep at least one space for the described case. Pick-to: 6.2 6.1 Fixes: QTBUG-94400 Change-Id: Ice268da36174ef5cf4398d2aee8fcd4731336316 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Fix internal module mappings of the qtdeclarative repoAlexey Edelev2021-06-111-2/+2
| | | | | | | | Add 'Private' suffix to the internal module names in the mappings of the qmake files for modules of the qtdeclarative repo. Change-Id: I1592ebad0f0db553322ea766561b1b8c3fd38aea Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add the check for linker capabilities to resolve circular dependenciesAlexey Edelev2021-06-108-2/+202
| | | | | | | | | | | | | | 'ld' only capable to resolve circular dependencies by wrapping the suspected static libraries and objects using --start/end-group arguments. We want to detect if linker is 'ld' at configure time to decide how to link the resource objects if finalizers are not enabled. The qt_config_compile_test function is extended with an extra argument since it's required to pass custom cmake flags to the ld-related test. Pick-to: 6.2 Change-Id: I484fcc99e2886952d8b0232f37e4e6a35d072931 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Fix global 'apk' target to apply to Qt EXTERNAL_BUILD examplesAlexandru Croitor2021-06-081-0/+17
| | | | | | | | | | | This means calling 'ninja apk' in a Qt build with examples configured will build all example apks, regardless of whether the examples are built as external projects or in-tree. Fixes: QTBUG-94264 Change-Id: I5c7af0354858898a2e154a6d54fb025e4d81ff80 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* wasm: fix threaded buildsLorn Potter2021-06-081-2/+4
| | | | | | | set the thread pool size default to 4 Change-Id: I038a81610c82ac4d162c044d0e1f58196cffc7b7 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* CMake: Add support for building with clang-clCristian Adam2021-06-042-2/+4
| | | | | | | | | qmake had support for building with clang-cl as the win32-clang-msvc mkspec. Task-number: QTBUG-89642 Task-number: QTBUG-88081 Change-Id: I0709c289f90fedb121620d1e67ef841602219816 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Remove CMake compatibility functions for old APIJoerg Bornemann2021-06-043-114/+0
| | | | | | | | | All repositories define QT_NO_INTERNAL_COMPATIBILITY_FUNCTIONS by now, and we can remove QtCompatibilityHelpers.cmake altogether. Change-Id: I4d8104246e96a4514d5651c104607d651d208d95 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix support for using system supplied md4c libraryNiclas Rosenvik2021-06-031-0/+24
| | | | | | | | | | | | | | | | | | | Add FindWrapSystemMd4c.cmake so that the old md4c target can be used as well as the new one and set WrapSystemMd4c_FOUND. Link to the imported target WrapSystemMd4c::WrapSystemMd4c if the system library is used. Add qt_find_package line to find the package in configure.cmake. Fix the condition for enabling system-textmarkdownreader, it includes testing for textmarkdownreader because even if the code would compile correctly without it, it looks strange when the output says "textmarkdownreader no" and under "using system libmd4c yes" even if libmd4c is not used. Use system include when system-markdownreader is enabled. Add library mapping for libmd4c. Change-Id: Id5d5b13d6691a8c1cdf627238887977c847c1e67 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Move resource object files to the beginning of linker line in .prl filesAlexey Edelev2021-06-031-1/+1
| | | | | | | | | Move collected resource objects to the beginning of the linker line to prevent order-related issues. Fixes: QTBUG-92250 Change-Id: Ia046f2820feb693bfadc2b60e07fa001638d4d7b Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix location of qtattributionsscanner in doc buildsKai Köhne2021-06-031-6/+9
| | | | | | | | qtattributionsscanner is now found in libexec. Task-number: QTBUG-88791 Change-Id: Ie704663012be92b0c223d9d57210ec1874abff0b Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Make framework names consistent with the module namesAlexey Edelev2021-06-034-18/+25
| | | | | | | | | | | | | | | | | | For Apple's frameworks it's possible to include header files using the following assumption: If the framework name is "MyFramework" then '#include <MyFramework/frameworkheader.h>' will work without specifying the include path explicitly. This is broken for internal modules since they use the framework name with the 'Private' suffix. This uses the module name instead of the target name as a framework name. Amends edbe0eb335ca4c0fde23f57eae5acdf80937c9e3 Task-number: QTBUG-87775 Change-Id: I0592a28d0768724b6e10ca81aa7cefb0a3699a5e Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Collect resource objects of plugins and their dependencies in finalizerAlexey Edelev2021-06-031-2/+32
| | | | | | | | | | | | | Resource objects might be linked to plugins. Since some plugins may be present in LINK_LIBRARIES as the complex genexes, need to collect them explicitly and iterate over plugin targets to find resource object libraries that need to be exposed to end-point target executable. Amends a1fd4f51ada82854f35654158a334454e760a9f7 Change-Id: Icd85f54f7bf9d1b7e3382caa5d9aa62449b6adb8 Reviewed-by: Lorn Potter <lorn.potter@gmail.com> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Explicitly generate static plugin helpers into binary dirUlf Hermann2021-06-031-2/+2
| | | | | | | Before, it would erroneously look for them in the source directory. Change-Id: I6dcd3ccde3e57dba84639da2cd354c51e8a92459 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Fix generated prl and pri files for MSVCLi Xinwei2021-06-025-5/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In MSVC static build, if we build Qt with 3rdparty library (e.g. zstd), cmake will add"zstd" (without "-l" prefix) to Qt6Core.prl. Then we use this Qt to build a qmake project, compilation will fail due to missing zstd.obj. Without "-l" prefix, qmake will treat "zstd" as an object file instead of a library. Library names in qt_module.pri and qt_lib_*_private.pri are also missing "-l" prefix. This is because on most compilers, CMAKE_LINK_LIBRARY_FLAG equals "-l". But on MSVC, it is an empty string. So we should pass "-DLINK_LIBRARY_FLAG=-l" for MSVC. Also add "-L/path/to/library" if the library path is not in default linker search directories. This will write un-relocatable paths to prl files only when using 3rdparty libraries to build Qt statically. Usually it's not a problem. In addition, CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES is also empty on MSVC. So The third argument of "$<FILTER>" is empty, it is an invalid generator expression. This means no include dir will be written to qt_module.pri and qt_lib_*_private.pri on MSVC. So only use "$<FILTER>" when CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES is not empty. Pick-to: 6.1 Change-Id: Ib66f95dc09cf920363a4b9338fb97747dd2f8ab7 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix EXTRA_CMAKE_FILES behavior of qt_internal_add_toolJoerg Bornemann2021-06-011-9/+24
| | | | | | | | | | | | | ...and make it consistent with that of qt_internal_add_module. Make EXTRA_CMAKE_FILES a multi value keyword. Do not add include statements for every file in EXTRA_CMAKE_FILES. Add the EXTRA_CMAKE_INCLUDES argument to specify includes. This enables us to specify EXTRA_CMAKE_FILE that are not included. Change-Id: I1a3667473b94ee44363b554ab9e6c380e5c11389 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Pass OpenGL_GL_PREFERENCE variable to other Qt reposJoerg Bornemann2021-06-011-0/+8
| | | | | | | | | | | | | | When building Linux packages, we pass OpenGL_GL_PREFERENCE=LEGACY when building qtbase. This is done to link against legacy OpenGL libs. When building non-qtbase repos, we also need to set this variable to the same value we have in qtbase. Pick-to: 6.1 Task-number: QTBUG-89754 Fixes: QTBUG-94040 Change-Id: I567b629d245025d2b1544b91cfc265a9c921725f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Do not get LINK_LIBRARY of the interface librariesAlexey Edelev2021-06-011-1/+7
| | | | | | | | | | Avoid getting the LINK_LIBRARY property of the interface libraries when calling a resource object finalizer. Amends a1fd4f51ada82854f35654158a334454e760a9f7 Change-Id: I19d625a927c66994902f5c89e6c82183c94af91e Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Create global imported versionless tool targetsAlexandru Croitor2021-06-011-1/+1
| | | | | | | | | | | | | | Versioned tool targets are always promoted to global targets. Versionless ones were not promoted to global targets. This was an oversight which caused issues with conditions like if(TARGET Qt::Tool) in top-level builds. Fixes: QTBUG-93839 Change-Id: I5176899b5d0d80bfd0b350bc9c4b3fa5b53c0777 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Allow printing config summary even if module is not builtAlexandru Croitor2021-06-012-1/+23
| | | | | | | | | | | | | | In the future it might be useful to print the config summary entries of a Qt module configure.cmake file even if the associated module is not built and thus qt_feature_module_begin is not called. The repo src/CMakeLists.txt could then use a combination of qt_feature_evaluate_features and a conditional qt_feature_record_summary_entries to ensure the that summary entries are still shown. Change-Id: I124efc82163ddae48d9e72c70a677ec4c6588fac Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>