From 501f31e03bb419c22b7e6c5ab075058d5c236585 Mon Sep 17 00:00:00 2001 From: kervala Date: Fri, 25 Dec 2015 15:31:34 +0100 Subject: [PATCH] Fixed: Define QT_NO_DEBUG in Release with Qt 5 also in PCH --- code/CMakeModules/PCHSupport.cmake | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/code/CMakeModules/PCHSupport.cmake b/code/CMakeModules/PCHSupport.cmake index dafe72a5a..fa36fd008 100644 --- a/code/CMakeModules/PCHSupport.cmake +++ b/code/CMakeModules/PCHSupport.cmake @@ -145,19 +145,22 @@ MACRO(PCH_SET_COMPILE_FLAGS _target) ENDFOREACH() ENDIF() - # Hack to define missing QT_NO_DEBUG with Qt 5.2 - IF(USE_QT5 AND _UPPER_BUILD STREQUAL "RELEASE") - LIST(APPEND GLOBAL_DEFINITIONS " -DQT_NO_DEBUG") - ENDIF() + # Special Qt 5 cases + IF(GLOBAL_DEFINITIONS MATCHES "QT_CORE_LIB") + # Hack to define missing QT_NO_DEBUG with Qt 5.2 + IF(_UPPER_BUILD STREQUAL "RELEASE") + LIST(APPEND GLOBAL_DEFINITIONS " -DQT_NO_DEBUG") + ENDIF() - # Qt5_POSITION_INDEPENDENT_CODE should be true if Qt was compiled with PIE - IF(Qt5_POSITION_INDEPENDENT_CODE AND GLOBAL_DEFINITIONS MATCHES "QT_CORE_LIB") - SET(_USE_PIE ON) - ENDIF() + # Qt5_POSITION_INDEPENDENT_CODE should be true if Qt was compiled with PIE + IF(Qt5_POSITION_INDEPENDENT_CODE) + SET(_USE_PIE ON) + ENDIF() - IF(_USE_PIE) - LIST(APPEND _FLAGS " ${CMAKE_CXX_COMPILE_OPTIONS_PIE}") - LIST(APPEND _FLAGS " ${CMAKE_CXX_COMPILE_OPTIONS_PIC}") + IF(_USE_PIE) + LIST(APPEND _FLAGS " ${CMAKE_CXX_COMPILE_OPTIONS_PIE}") + LIST(APPEND _FLAGS " ${CMAKE_CXX_COMPILE_OPTIONS_PIC}") + ENDIF() ENDIF() LIST(APPEND _FLAGS " ${GLOBAL_DEFINITIONS}")