summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorBen Boeckel <mathstuf@gmail.com>2015-02-04 11:41:05 -0500
committerBen Boeckel <mathstuf@gmail.com>2015-02-07 20:51:06 -0500
commit0fd1763e028be5ef6a4fd695a18ae19234ebdaf7 (patch)
treeb816eb891a0bf55a37db23524baf349e20b5c7e1 /CMakeLists.txt
parent91498e200292ef5f309fc0b7420f8a5bc8e308cc (diff)
downloadcoreclr-0fd1763e028be5ef6a4fd695a18ae19234ebdaf7.tar.gz
coreclr-0fd1763e028be5ef6a4fd695a18ae19234ebdaf7.tar.bz2
coreclr-0fd1763e028be5ef6a4fd695a18ae19234ebdaf7.zip
Simplify configuration-specific definitions in CMake
Factor out the configurations supported rather than duplicating the logic three times.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt19
1 files changed, 5 insertions, 14 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 145b798130..0958c9d7cf 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -75,20 +75,11 @@ endfunction()
if (WIN32)
# For multi-configuration toolset (as Visual Studio)
# set the different configuration defines.
- # First DEBUG
- foreach (Definition IN LISTS CLR_DEFINES_DEBUG_INIT)
- set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:DEBUG>:${Definition}>)
- endforeach (Definition)
-
- # Then RELEASE
- foreach (Definition IN LISTS CLR_DEFINES_RELEASE_INIT)
- set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:RELEASE>:${Definition}>)
- endforeach (Definition)
-
- # And then RELWITHDEBINFO
- foreach (Definition IN LISTS CLR_DEFINES_RELWITHDEBINFO_INIT)
- set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:RELWITHDEBINFO>:${Definition}>)
- endforeach (Definition)
+ foreach (Config DEBUG RELEASE RELWITHDEBINFO)
+ foreach (Definition IN LISTS CLR_DEFINES_${Config}_INIT)
+ set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:${Config}>:${Definition}>)
+ endforeach (Definition)
+ endforeach (Config)
elseif (CLR_CMAKE_PLATFORM_UNIX)
# Set the values to display when interactively configuring CMAKE_BUILD_TYPE