summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGilles Khouzam <gillesk@microsoft.com>2017-01-26 15:34:24 -0800
committerBrad King <brad.king@kitware.com>2017-01-27 09:09:15 -0500
commitf01045ea36621fbc66a87bb041cd403d47304211 (patch)
treea950ee4e9035806328ddc255b1724af549275e2e
parentb8db2ed79675930421ac96256d63af515e624d38 (diff)
downloadcmake-f01045ea36621fbc66a87bb041cd403d47304211.tar.gz
Tests: Make Preprocess test work in RelWithDebInfo and MinSizeRel
-rw-r--r--Tests/Preprocess/CMakeLists.txt14
1 files changed, 10 insertions, 4 deletions
diff --git a/Tests/Preprocess/CMakeLists.txt b/Tests/Preprocess/CMakeLists.txt
index 15f0338ad4..807a4272c9 100644
--- a/Tests/Preprocess/CMakeLists.txt
+++ b/Tests/Preprocess/CMakeLists.txt
@@ -214,18 +214,24 @@ set(FILE_PATH "${Preprocess_SOURCE_DIR}/file_def.h")
set(TARGET_PATH "${Preprocess_SOURCE_DIR}/target_def.h")
# Set some definition properties.
-foreach(c "" "_DEBUG" "_RELEASE")
+foreach(c "" "_DEBUG" "_RELEASE" "_RELWITHDEBINFO" "_MINSIZEREL")
+ set(FLAVOR "${c}")
+ # Treat RelWithDebInfo and MinSizeRel as Release to avoid having
+ # an exponentional matrix of inclusions and exclusions of defines
+ if("${c}" STREQUAL "_RELWITHDEBINFO" OR "${c}" STREQUAL "_MINSIZEREL")
+ set(FLAVOR "_RELEASE")
+ endif()
set_property(
DIRECTORY .
- APPEND PROPERTY COMPILE_DEFINITIONS${c} "DIRECTORY_DEF${c}"
+ APPEND PROPERTY COMPILE_DEFINITIONS${c} "DIRECTORY_DEF${FLAVOR}"
)
set_property(
TARGET Preprocess
- PROPERTY COMPILE_DEFINITIONS${c} "TARGET_DEF${c}"
+ PROPERTY COMPILE_DEFINITIONS${c} "TARGET_DEF${FLAVOR}"
)
set_property(
SOURCE preprocess.c preprocess.cxx
- PROPERTY COMPILE_DEFINITIONS${c} "FILE_DEF${c}"
+ PROPERTY COMPILE_DEFINITIONS${c} "FILE_DEF${FLAVOR}"
)
endforeach()