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>
This commit is contained in:
Leander Beernaert 2020-02-19 16:22:42 +01:00
parent a75d610d5f
commit f03a51a404
2 changed files with 2 additions and 4 deletions

View File

@ -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}"

View File

@ -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