summaryrefslogtreecommitdiffstats
path: root/src/corelib/CMakeLists.txt
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2021-03-19 17:15:06 +0100
committerAlexandru Croitor <alexandru.croitor@qt.io>2021-03-19 21:42:15 +0100
commitd68486547aaf05994f39786f8527bcb454c6db3f (patch)
tree57dfc35e7319a8f0173ffe44b38627651fe0b7bc /src/corelib/CMakeLists.txt
parente9e3c09f4b17e7663fe15d9f9a732015fe2a9aa7 (diff)
CMake: Get rid of the Core_versiontagging object library
We don't currently handle object libraries when creating prl files for static Qt builds, so it's best to compile files as part of the main Core target. Use source file COMPILE_OPTIONS to add the -fno-lto flag to the global/qversiontagging.cpp source file. Amends 2d4a40f93fd3f0fd31110ef7d19a12fc56c00967 Pick-to: 6.1 6.0 Change-Id: Iac1d37ecb4caa7c9889d44b3a103a9bdafec49f3 Reviewed-by: Christophe Giboudeaux <christophe@krop.fr> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'src/corelib/CMakeLists.txt')
-rw-r--r--src/corelib/CMakeLists.txt21
1 files changed, 4 insertions, 17 deletions
diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt
index 04c2cc1881..ab73d8b98c 100644
--- a/src/corelib/CMakeLists.txt
+++ b/src/corelib/CMakeLists.txt
@@ -618,29 +618,16 @@ qt_internal_extend_target(Core CONDITION QT_FEATURE_journald
PkgConfig::Libsystemd
)
-# special case begin
-add_library(Core_versiontagging OBJECT
- global/qversiontagging.cpp global/qversiontagging.h
-)
-
-set_target_properties(Core_versiontagging PROPERTIES
- COMPILE_OPTIONS $<TARGET_PROPERTY:Core,COMPILE_OPTIONS>
- COMPILE_DEFINITIONS $<TARGET_PROPERTY:Core,COMPILE_DEFINITIONS>
- INCLUDE_DIRECTORIES $<TARGET_PROPERTY:Core,INCLUDE_DIRECTORIES>
-)
+set(core_version_tagging_files global/qversiontagging.cpp global/qversiontagging.h)
+target_sources(Core PRIVATE ${core_version_tagging_files})
# Disable LTO, as the symbols disappear somehow under GCC
# (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48200)
if(GCC AND FEATURE_ltcg)
- target_compile_options(Core_versiontagging PRIVATE "-fno-lto")
+ set_source_files_properties(${core_version_tagging_files}
+ PROPERTIES COMPILE_OPTIONS "-fno-lto")
endif()
-qt_internal_extend_target(Core
- SOURCES
- $<TARGET_OBJECTS:Core_versiontagging>
-)
-# special case end
-
qt_internal_extend_target(Core CONDITION UNIX
SOURCES
io/qfilesystemengine_unix.cpp