[llvm] r209163 - cmake: Remove -D NDEBUG from CFLAGS as well as CXXFLAGS
Reid Kleckner
reid at kleckner.net
Mon May 19 14:13:41 PDT 2014
Author: rnk
Date: Mon May 19 16:13:41 2014
New Revision: 209163
URL: http://llvm.org/viewvc/llvm-project?rev=209163&view=rev
Log:
cmake: Remove -D NDEBUG from CFLAGS as well as CXXFLAGS
This silences ~7 warnings on .c files in the LLVM build.
Modified:
llvm/trunk/cmake/modules/HandleLLVMOptions.cmake
Modified: llvm/trunk/cmake/modules/HandleLLVMOptions.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/HandleLLVMOptions.cmake?rev=209163&r1=209162&r2=209163&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/HandleLLVMOptions.cmake (original)
+++ llvm/trunk/cmake/modules/HandleLLVMOptions.cmake Mon May 19 16:13:41 2014
@@ -56,13 +56,16 @@ if( LLVM_ENABLE_ASSERTIONS )
if( NOT uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG" )
add_definitions( -UNDEBUG )
# Also remove /D NDEBUG to avoid MSVC warnings about conflicting defines.
- set(REGEXP_NDEBUG "(^| )[/-]D *NDEBUG($| )")
- string (REGEX REPLACE "${REGEXP_NDEBUG}" " "
- CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
- string (REGEX REPLACE "${REGEXP_NDEBUG}" " "
- CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
- string (REGEX REPLACE "${REGEXP_NDEBUG}" " "
- CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL}")
+ foreach (flags_var_to_scrub
+ CMAKE_CXX_FLAGS_RELEASE
+ CMAKE_CXX_FLAGS_RELWITHDEBINFO
+ CMAKE_CXX_FLAGS_MINSIZEREL
+ CMAKE_C_FLAGS_RELEASE
+ CMAKE_C_FLAGS_RELWITHDEBINFO
+ CMAKE_C_FLAGS_MINSIZEREL)
+ string (REGEX REPLACE "(^| )[/-]D *NDEBUG($| )" " "
+ "${flags_var_to_scrub}" "${${flags_var_to_scrub}}")
+ endforeach()
endif()
else()
if( NOT uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE" )
More information about the llvm-commits
mailing list