diff options
author | Brad King <brad.king@kitware.com> | 2017-03-29 13:14:50 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2017-03-29 13:14:54 (GMT) |
commit | 6dc7262bf77f551a7f3c36d7ca3023c63ef20af8 (patch) | |
tree | 456a43d8f048f74bfc8de345c0a984c58431d9b4 /Modules | |
parent | 4a6a27ad85a4be666a3bb4260105a54ba1cea0eb (diff) | |
parent | fff34934e70da77c359e47c53ffd04701bcd7611 (diff) | |
download | CMake-6dc7262bf77f551a7f3c36d7ca3023c63ef20af8.zip CMake-6dc7262bf77f551a7f3c36d7ca3023c63ef20af8.tar.gz CMake-6dc7262bf77f551a7f3c36d7ca3023c63ef20af8.tar.bz2 |
Merge topic 'vs-rc-defines'
fff34934 MSVC: Restore _DEBUG preprocessor definition in RC debug builds
79a91538 RC: Add missing CMAKE_RC_FLAGS_<CONFIG> entries to cache
c77194ec VS: Honor preprocessor definitions in RC flags
1449f6f6 cmVisualStudio10TargetGenerator: De-duplicate preprocessor defs
8a619e8c cmIDEOptions: Add GetDefines method
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !640
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/CMakeRCInformation.cmake | 17 | ||||
-rw-r--r-- | Modules/Platform/Windows-MSVC.cmake | 3 |
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) |