summaryrefslogtreecommitdiffstats
path: root/cmake/QtBuild.cmake
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2020-07-03 17:33:34 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2020-07-05 13:54:02 +0200
commit7067b2ca6e08e683bb9c202a7e3c1b10d08622ee (patch)
tree4e1c9cc5a9c7f188742b47c59e8a5d3fc1ab4c7c /cmake/QtBuild.cmake
parent864466d2e5ae9ab7a2e01a7da3abc5a4c0b16bda (diff)
CMake: Don't propagate private defines for Qt header modules
Interface libraries like our Qt header modules should not propagated private defines which are meant only for building a specific Qt module, and in the case of a header module there is nothing to build. Exclude the usual private defines we set in qt_add_module for header modules. This also fixes the content of header module .pri files. Change-Id: I0791ebdb73e8b020ddb8116433ed36c7b3d71303 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'cmake/QtBuild.cmake')
-rw-r--r--cmake/QtBuild.cmake22
1 files changed, 15 insertions, 7 deletions
diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake
index f27212d4d1..0f83c6e1ee 100644
--- a/cmake/QtBuild.cmake
+++ b/cmake/QtBuild.cmake
@@ -2843,6 +2843,20 @@ function(qt_add_module target)
add_custom_target(${target}_timestamp ALL DEPENDS "${timestamp_file}")
endif()
+ set(defines_for_extend_target "")
+
+ if(NOT arg_HEADER_MODULE)
+ list(APPEND defines_for_extend_target
+ QT_NO_CAST_TO_ASCII QT_ASCII_CAST_WARNINGS
+ QT_MOC_COMPAT #we don't need warnings from calling moc code in our generated code
+ QT_USE_QSTRINGBUILDER
+ QT_DEPRECATED_WARNINGS
+ QT_BUILDING_QT
+ QT_BUILD_${module_define}_LIB ### FIXME: use QT_BUILD_ADDON for Add-ons or remove if we don't have add-ons anymore
+ "${deprecation_define}"
+ )
+ endif()
+
qt_extend_target("${target}"
${header_module}
SOURCES ${arg_SOURCES}
@@ -2855,13 +2869,7 @@ function(qt_add_module target)
QT_${module_define}_LIB
DEFINES
${arg_DEFINES}
- QT_NO_CAST_TO_ASCII QT_ASCII_CAST_WARNINGS
- QT_MOC_COMPAT #we don't need warnings from calling moc code in our generated code
- QT_USE_QSTRINGBUILDER
- QT_DEPRECATED_WARNINGS
- QT_BUILDING_QT
- QT_BUILD_${module_define}_LIB ### FIXME: use QT_BUILD_ADDON for Add-ons or remove if we don't have add-ons anymore
- "${deprecation_define}"
+ ${defines_for_extend_target}
PUBLIC_LIBRARIES ${arg_PUBLIC_LIBRARIES}
LIBRARIES ${arg_LIBRARIES} Qt::PlatformModuleInternal
PRIVATE_MODULE_INTERFACE ${arg_PRIVATE_MODULE_INTERFACE}