summaryrefslogtreecommitdiffstats
path: root/cmake/QtInternalTargets.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/QtInternalTargets.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/QtInternalTargets.cmake')
-rw-r--r--cmake/QtInternalTargets.cmake10
1 files changed, 10 insertions, 0 deletions
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()