summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2019-06-24 14:59:21 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2019-06-24 13:30:14 +0000
commit1a2a3b72bf8bd3905098d7052287204380e0bfa1 (patch)
tree43195e0eae5db85e301308d0c316c16a0874b274 /cmake
parentcccc9fc59be715b920c7bcaef327b06bbbbbfa99 (diff)
Add PlatformCommonInternal target and QT_NO_DEBUG definition
All the other PlatformModuleInternal, PlatformPluginInternal, PlatformToolInternal target will depend on the common one. Also add the QT_NO_DEBUG definition when the build type is not Debug. This fixes the lookup of the Qt platform plugin on macOS, which uses a "_debug" prefix in the plugin name depending on if the QT_NO_DEBUG definition is present or not. This is the same as it is done in mkspecs/features/qt.prf. Change-Id: I82cf461d44b8a3b3c5dc2b2d9f25baa246fc1e4b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/QtBaseGlobalTargets.cmake10
-rw-r--r--cmake/QtInternalTargets.cmake10
2 files changed, 18 insertions, 2 deletions
diff --git a/cmake/QtBaseGlobalTargets.cmake b/cmake/QtBaseGlobalTargets.cmake
index 05a41ee3e7..5bb0925f5b 100644
--- a/cmake/QtBaseGlobalTargets.cmake
+++ b/cmake/QtBaseGlobalTargets.cmake
@@ -91,10 +91,16 @@ target_include_directories(GlobalConfigPrivate INTERFACE
)
add_library(Qt::GlobalConfigPrivate ALIAS GlobalConfigPrivate)
-# defines PlatformModuleInternal PlatformPluginInternal PlatformToolInternal
+# defines PlatformCommonInternal PlatformModuleInternal PlatformPluginInternal PlatformToolInternal
include(QtInternalTargets)
-set(__export_targets Platform GlobalConfig GlobalConfigPrivate PlatformModuleInternal PlatformPluginInternal PlatformToolInternal)
+set(__export_targets Platform
+ GlobalConfig
+ GlobalConfigPrivate
+ PlatformCommonInternal
+ PlatformModuleInternal
+ PlatformPluginInternal
+ PlatformToolInternal)
set(__export_name "${INSTALL_CMAKE_NAMESPACE}Targets")
qt_install(TARGETS ${__export_targets} EXPORT "${__export_name}")
qt_install(EXPORT ${__export_name}
diff --git a/cmake/QtInternalTargets.cmake b/cmake/QtInternalTargets.cmake
index f289326de0..1fb1cc7fcd 100644
--- a/cmake/QtInternalTargets.cmake
+++ b/cmake/QtInternalTargets.cmake
@@ -57,14 +57,20 @@ function(qt_internal_set_warnings_are_errors_flags target)
endif()
endfunction()
+add_library(PlatformCommonInternal INTERFACE)
+add_library(Qt::PlatformCommonInternal ALIAS PlatformCommonInternal)
+
add_library(PlatformModuleInternal INTERFACE)
add_library(Qt::PlatformModuleInternal ALIAS PlatformModuleInternal)
+target_link_libraries(PlatformModuleInternal INTERFACE PlatformCommonInternal)
add_library(PlatformPluginInternal INTERFACE)
add_library(Qt::PlatformPluginInternal ALIAS PlatformPluginInternal)
+target_link_libraries(PlatformPluginInternal INTERFACE PlatformCommonInternal)
add_library(PlatformToolInternal INTERFACE)
add_library(Qt::PlatformToolInternal ALIAS PlatformToolInternal)
+target_link_libraries(PlatformToolInternal INTERFACE PlatformCommonInternal)
if(WARNINGS_ARE_ERRORS)
qt_internal_set_warnings_are_errors_flags(PlatformModuleInternal)
@@ -86,3 +92,7 @@ endif()
if (ANDROID)
target_link_options(PlatformModuleInternal INTERFACE -fuse-ld=lld)
endif()
+
+if(NOT CMAKE_BUILD_TYPE STREQUAL Debug)
+ target_compile_definitions(PlatformCommonInternal INTERFACE QT_NO_DEBUG)
+endif()