From f03a51a404b0ef1fe54458937468d365bfed7ca4 Mon Sep 17 00:00:00 2001 From: Leander Beernaert Date: Wed, 19 Feb 2020 16:22:42 +0100 Subject: [PATCH] CMake: Fix use of compile define QT_NO_DEBUG Prior to this patch QT_NO_DEBUG would not be correctly set for generators which support multiple configurations such as Visual Studio and XCode. This patch also applies the define to all executables, which was previously missing. Change-Id: I16a911d15217a62093c68ba2b4c2545cdb8df1e6 Reviewed-by: Alexandru Croitor --- cmake/QtBuild.cmake | 2 +- cmake/QtInternalTargets.cmake | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 9949f6bb20f..58f820416c0 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -2534,7 +2534,7 @@ function(qt_add_executable name) SOURCES ${arg_SOURCES} INCLUDE_DIRECTORIES ${private_includes} DEFINES ${arg_DEFINES} - LIBRARIES ${arg_LIBRARIES} + LIBRARIES ${arg_LIBRARIES} Qt::PlatformCommonInternal PUBLIC_LIBRARIES ${extra_libraries} ${arg_PUBLIC_LIBRARIES} DBUS_ADAPTOR_SOURCES "${arg_DBUS_ADAPTOR_SOURCES}" DBUS_ADAPTOR_FLAGS "${arg_DBUS_ADAPTOR_FLAGS}" diff --git a/cmake/QtInternalTargets.cmake b/cmake/QtInternalTargets.cmake index 54e7f4f50e0..2d3b6769cc8 100644 --- a/cmake/QtInternalTargets.cmake +++ b/cmake/QtInternalTargets.cmake @@ -97,9 +97,7 @@ 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() +target_compile_definitions(PlatformCommonInternal INTERFACE $<$>:QT_NO_DEBUG>) if(APPLE_UIKIT) # Do what mkspecs/features/uikit/default_pre.prf does, aka enable sse2 for