diff options
author | Leander Beernaert <leander.beernaert@qt.io> | 2020-02-19 16:22:42 +0100 |
---|---|---|
committer | Leander Beernaert <leander.beernaert@qt.io> | 2020-02-20 16:11:01 +0100 |
commit | f03a51a404b0ef1fe54458937468d365bfed7ca4 (patch) | |
tree | 96a599e8692e141419f9fdeba2ec40c4d55feb54 /cmake | |
parent | a75d610d5f85a7f89b0b837223b27a5239b2eec5 (diff) |
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 <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/QtBuild.cmake | 2 | ||||
-rw-r--r-- | cmake/QtInternalTargets.cmake | 4 |
2 files changed, 2 insertions, 4 deletions
diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 9949f6bb20..58f820416c 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 54e7f4f50e..2d3b6769cc 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 $<$<NOT:$<CONFIG:Debug>>:QT_NO_DEBUG>) if(APPLE_UIKIT) # Do what mkspecs/features/uikit/default_pre.prf does, aka enable sse2 for |