diff options
author | Brad King <brad.king@kitware.com> | 2022-09-01 16:19:33 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2022-09-01 16:29:22 (GMT) |
commit | 44189d82a7d20d0d74c6d4c8c5ac9314a5af4947 (patch) | |
tree | b26bb7b2a3abb3d1ed53e5be5e4c185aefd37c77 /Tests/Preprocess | |
parent | d10cbb05906de570f45d873296867dad4f90d93a (diff) | |
download | CMake-44189d82a7d20d0d74c6d4c8c5ac9314a5af4947.zip CMake-44189d82a7d20d0d74c6d4c8c5ac9314a5af4947.tar.gz CMake-44189d82a7d20d0d74c6d4c8c5ac9314a5af4947.tar.bz2 |
Tests: Fix some tests under CFLAGS=-DNDEBUG CXXFLAGS=-DNDEBUG
Fixes: #23888
Diffstat (limited to 'Tests/Preprocess')
-rw-r--r-- | Tests/Preprocess/CMakeLists.txt | 7 | ||||
-rw-r--r-- | Tests/Preprocess/preprocess.c | 2 | ||||
-rw-r--r-- | Tests/Preprocess/preprocess.cxx | 2 |
3 files changed, 8 insertions, 3 deletions
diff --git a/Tests/Preprocess/CMakeLists.txt b/Tests/Preprocess/CMakeLists.txt index 4347459..84ca5e8 100644 --- a/Tests/Preprocess/CMakeLists.txt +++ b/Tests/Preprocess/CMakeLists.txt @@ -197,9 +197,14 @@ endif() #----------------------------------------------------------------------------- # Inform the test if the debug configuration is getting built. -# The NDEBUG definition takes care of this for release. string(APPEND CMAKE_C_FLAGS_DEBUG " -DPREPROCESS_DEBUG") string(APPEND CMAKE_CXX_FLAGS_DEBUG " -DPREPROCESS_DEBUG") +string(APPEND CMAKE_C_FLAGS_RELEASE " -DPREPROCESS_NDEBUG") +string(APPEND CMAKE_CXX_FLAGS_RELEASE " -DPREPROCESS_NDEBUG") +string(APPEND CMAKE_C_FLAGS_RELWITHDEBINFO " -DPREPROCESS_NDEBUG") +string(APPEND CMAKE_CXX_FLAGS_RELWITHDEBINFO " -DPREPROCESS_NDEBUG") +string(APPEND CMAKE_C_FLAGS_MINSIZEREL " -DPREPROCESS_NDEBUG") +string(APPEND CMAKE_CXX_FLAGS_MINSIZEREL " -DPREPROCESS_NDEBUG") # Inform the test if it built from Xcode. if(PP_XCODE) diff --git a/Tests/Preprocess/preprocess.c b/Tests/Preprocess/preprocess.c index b3117da..88f9e97 100644 --- a/Tests/Preprocess/preprocess.c +++ b/Tests/Preprocess/preprocess.c @@ -33,7 +33,7 @@ int check_defines_C(void) result = 0; } } -#ifdef NDEBUG +#ifdef PREPROCESS_NDEBUG # ifdef FILE_DEF_DEBUG { fprintf(stderr, "FILE_DEF_DEBUG should not be defined in C\n"); diff --git a/Tests/Preprocess/preprocess.cxx b/Tests/Preprocess/preprocess.cxx index f2fffef..50150d1 100644 --- a/Tests/Preprocess/preprocess.cxx +++ b/Tests/Preprocess/preprocess.cxx @@ -35,7 +35,7 @@ int check_defines_CXX() result = 0; } } -#ifdef NDEBUG +#ifdef PREPROCESS_NDEBUG # ifdef FILE_DEF_DEBUG { fprintf(stderr, "FILE_DEF_DEBUG should not be defined in CXX\n"); |