Commit Graph

9 Commits

Author SHA1 Message Date
Joerg Bornemann
c09df7b57c CMake: Implement configure -reduce-exports
This option maps to FEATURE_reduce_exports. The feature is on by
default, except for MSVC. The reduce_exports configure test is not used
in the CMake build.

The <LANG>_VISIBILITY_PRESET and VISIBILITY_INLINES_HIDDEN target
properties are now explicitly initialized in the
qt_set_common_target_properties function, because we don't have access
to the feature in QtSetup.cmake where the CMAKE_<LANG>_VISIBILITY_PRESET
variables were set before.

Task-number: QTBUG-85373
Change-Id: I378453f0e0665731970016170302871e20ceb4e2
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-10-05 10:05:20 +02:00
Joerg Bornemann
3d54f47cea CMake: Generate *AdditionalTargetInfo.cmake for tools
This ensures that we have the configuration-independent IMPORTED_*
properties set on tools.

Fixes: QTBUG-86893
Change-Id: I2b772c21341e6e4631379d4a5a99580ec96909ed
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-09-28 17:29:38 +02:00
Joerg Bornemann
347d2163b2 CMake: Write proper *AdditionalTargetInfo file in debug-only build
To provide the IMPORTED_LOCATION target property we must write
the *AdditionalTargetInfo.cmake file for all debug-only builds, not only
the ones containing a release configuration.

Task-number: QTBUG-86893
Change-Id: I9ecd01483660f434a3f1ea12fa2af756cdcf9932
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-09-28 17:29:35 +02:00
Joerg Bornemann
893ee16352 CMake: Fix build of Release user projects against RelWithDebInfo Qt
Building a user project in Release configuration against a Qt built with
CMAKE_CONFIGURATION_TYPES=RelWithDebInfo;Debug led to the user project
being linked against the Debug Qt libraries. This is especially painful
with MSVC where debug and release runtimes are incompatible.

We now create *AdditionalTargetInfo.cmake files along the
exported *Targets.cmake files that set the IMPORT_*_<CONFIG> properties
to the values of the release config Qt was built with.

User projects built with an unknown
configuration (CMAKE_BUILD_TYPE=ArbitraryName) will link against a
release Qt. This can be controlled by setting the variable
QT_DEFAULT_IMPORT_CONFIGURATION to, for example, DEBUG in the user
project.

Fixes: QTBUG-86743
Change-Id: I12c4b065a9845c7317f6acddab46b649f2732c9e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-09-25 17:02:52 +02:00
Alexandru Croitor
e0c62a48b8 CMake: Rename internal functions to contain qt_internal
Offer compatibility wrapper functions until we update all of the Qt
repos to use the new names.

Task-number: QTBUG-86815
Change-Id: I5826a4116f52a8509db32601ef7c200f9bd331de
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2020-09-23 16:59:05 +02:00
Joerg Bornemann
8a2ca17b2d CMake: Fix generation of XXX_tracepoints.cpp
The include directive was incorrectly written.
This amends 5c092c2b40.

Change-Id: Ia72ca3a5d5e1486ade4d71a764550d36979640f6
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-09-10 18:06:06 +02:00
Joerg Bornemann
2a9ef0ecee CMake: Fix call to tracegen when cross-compiling tools
We need to use the imported host tracegen target to generate files, not
the one we're going to cross-build.

This amends 5c092c2b40.

Change-Id: Ib74dd2d87110383c31216872eb55bebf5d90df37
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
2020-09-10 18:05:54 +02:00
Joerg Bornemann
5c092c2b40 CMake: Implement configure -trace
Task-number: QTBUG-85373
Change-Id: Ib9ac35ec98dd5b6c272f58f8a61a124d1d262ec0
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-09-01 13:35:39 +02:00
Alexandru Croitor
44cce1a2ea CMake: Split QtBuild.cmake into smaller files
QtBuild.cmake is huge. Split it.

Move module, plugin, tools, executables and test related functions out
of QtBuild.cmake into separate files.
Do the same for many other things too.

An additional requirement is that all the new Helpers files only
define functions and macros.
No global variable definitions are allowed, nor execution of commands
with side effects.

Some notes:
qt_install_qml_files is removed because it's dead code.

Some functions still need to be figured out, because they are
interspersed and depend on various global state assignments.

Task-number: QTBUG-86035
Change-Id: I21d79ff02eef923c202eb1000422888727cb0e2c
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-08-14 13:17:11 +02:00