From 1a2a3b72bf8bd3905098d7052287204380e0bfa1 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Mon, 24 Jun 2019 14:59:21 +0200 Subject: 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 --- cmake/QtBaseGlobalTargets.cmake | 10 ++++++++-- cmake/QtInternalTargets.cmake | 10 ++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) (limited to 'cmake') 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() -- cgit v1.2.3