summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-03-29 13:24:29 (GMT)
committerBrad King <brad.king@kitware.com>2017-03-29 13:24:29 (GMT)
commitd4a995750a1e3101f943a0d2e91fc9688f5e23f7 (patch)
tree65faf54646cf0a8549c490d60c3c1e503d5a17c3 /Modules
parent85abc5f5aa5f8afbca88e7b3e1c919db49756ecb (diff)
parentfff34934e70da77c359e47c53ffd04701bcd7611 (diff)
downloadCMake-d4a995750a1e3101f943a0d2e91fc9688f5e23f7.zip
CMake-d4a995750a1e3101f943a0d2e91fc9688f5e23f7.tar.gz
CMake-d4a995750a1e3101f943a0d2e91fc9688f5e23f7.tar.bz2
Merge branch 'vs-rc-defines' into release
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CMakeRCInformation.cmake17
-rw-r--r--Modules/Platform/Windows-MSVC.cmake3
2 files changed, 19 insertions, 1 deletions
diff --git a/Modules/CMakeRCInformation.cmake b/Modules/CMakeRCInformation.cmake
index 10f2cfb..7ddd297 100644
--- a/Modules/CMakeRCInformation.cmake
+++ b/Modules/CMakeRCInformation.cmake
@@ -17,11 +17,26 @@ set(CMAKE_SYSTEM_AND_RC_COMPILER_INFO_FILE
${CMAKE_ROOT}/Modules/Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}.cmake)
include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL)
-string(STRIP "$ENV{RCFLAGS} ${CMAKE_RC_FLAGS_INIT}" CMAKE_RC_FLAGS_INIT)
+set(CMAKE_RC_FLAGS_INIT "$ENV{RCFLAGS} ${CMAKE_RC_FLAGS_INIT}")
+
+foreach(c "" _DEBUG _RELEASE _MINSIZEREL _RELWITHDEBINFO)
+ string(STRIP "${CMAKE_RC_FLAGS${c}_INIT}" CMAKE_RC_FLAGS${c}_INIT)
+endforeach()
set (CMAKE_RC_FLAGS "${CMAKE_RC_FLAGS_INIT}" CACHE STRING
"Flags for Windows Resource Compiler.")
+if(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
+ set (CMAKE_RC_FLAGS_DEBUG "${CMAKE_RC_FLAGS_DEBUG_INIT}" CACHE STRING
+ "Flags for Windows Resource Compiler during debug builds.")
+ set (CMAKE_RC_FLAGS_MINSIZEREL "${CMAKE_RC_FLAGS_MINSIZEREL_INIT}" CACHE STRING
+ "Flags for Windows Resource Compiler during release builds for minimum size.")
+ set (CMAKE_RC_FLAGS_RELEASE "${CMAKE_RC_FLAGS_RELEASE_INIT}" CACHE STRING
+ "Flags for Windows Resource Compiler during release builds.")
+ set (CMAKE_RC_FLAGS_RELWITHDEBINFO "${CMAKE_RC_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING
+ "Flags for Windows Resource Compiler during release builds with debug info.")
+endif()
+
# These are the only types of flags that should be passed to the rc
# command, if COMPILE_FLAGS is used on a target this will be used
# to filter out any other flags
diff --git a/Modules/Platform/Windows-MSVC.cmake b/Modules/Platform/Windows-MSVC.cmake
index 31b26b5..e4aca6e 100644
--- a/Modules/Platform/Windows-MSVC.cmake
+++ b/Modules/Platform/Windows-MSVC.cmake
@@ -310,6 +310,9 @@ macro(__windows_compiler_msvc lang)
if(NOT CMAKE_RC_FLAGS_INIT)
string(APPEND CMAKE_RC_FLAGS_INIT " ${_PLATFORM_DEFINES} ${_PLATFORM_DEFINES_${lang}}")
endif()
+ if(NOT CMAKE_RC_FLAGS_DEBUG_INIT)
+ string(APPEND CMAKE_RC_FLAGS_DEBUG_INIT " /D_DEBUG")
+ endif()
enable_language(RC)
set(CMAKE_NINJA_CMCLDEPS_RC 1)