llvm.org GIT mirror llvm / 37b0592
cmake: Remove -D NDEBUG from CFLAGS as well as CXXFLAGS This silences ~7 warnings on .c files in the LLVM build. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209163 91177308-0d34-0410-b5e6-96231b3b80d8 Reid Kleckner 5 years ago
1 changed file(s) with 10 addition(s) and 7 deletion(s). Raw diff Collapse all Expand all
5555 if( NOT uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG" )
5656 add_definitions( -UNDEBUG )
5757 # Also remove /D NDEBUG to avoid MSVC warnings about conflicting defines.
58 set(REGEXP_NDEBUG "(^| )[/-]D *NDEBUG($| )")
59 string (REGEX REPLACE "${REGEXP_NDEBUG}" " "
60 CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
61 string (REGEX REPLACE "${REGEXP_NDEBUG}" " "
62 CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
63 string (REGEX REPLACE "${REGEXP_NDEBUG}" " "
64 CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL}")
58 foreach (flags_var_to_scrub
59 CMAKE_CXX_FLAGS_RELEASE
60 CMAKE_CXX_FLAGS_RELWITHDEBINFO
61 CMAKE_CXX_FLAGS_MINSIZEREL
62 CMAKE_C_FLAGS_RELEASE
63 CMAKE_C_FLAGS_RELWITHDEBINFO
64 CMAKE_C_FLAGS_MINSIZEREL)
65 string (REGEX REPLACE "(^| )[/-]D *NDEBUG($| )" " "
66 "${flags_var_to_scrub}" "${${flags_var_to_scrub}}")
67 endforeach()
6568 endif()
6669 else()
6770 if( NOT uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE" )