[llvm-commits] [llvm] r124399 - in /llvm/trunk: cmake/modules/AddLLVMDefinitions.cmake tools/llvm-config/CMakeLists.txt

Oscar Fuentes ofv at wanadoo.es
Thu Jan 27 11:29:48 PST 2011


Author: ofv
Date: Thu Jan 27 13:29:48 2011
New Revision: 124399

URL: http://llvm.org/viewvc/llvm-project?rev=124399&view=rev
Log:
Don't show -pedantic, -W and -Wall on the output of

llvm-config --cflags --cxxflags --cppflags

We shouldn't impose those flags on people who use llvm-config for
building their own projects.

Modified:
    llvm/trunk/cmake/modules/AddLLVMDefinitions.cmake
    llvm/trunk/tools/llvm-config/CMakeLists.txt

Modified: llvm/trunk/cmake/modules/AddLLVMDefinitions.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/AddLLVMDefinitions.cmake?rev=124399&r1=124398&r2=124399&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/AddLLVMDefinitions.cmake (original)
+++ llvm/trunk/cmake/modules/AddLLVMDefinitions.cmake Thu Jan 27 13:29:48 2011
@@ -5,7 +5,10 @@
 # Beware that there is no implementation of remove_llvm_definitions.
 
 macro(add_llvm_definitions)
-  set(LLVM_DEFINITIONS "${LLVM_DEFINITIONS} ${ARGN}")
+  # We don't want no semicolons on LLVM_DEFINITIONS:
+  foreach(arg ${ARGN})
+    set(LLVM_DEFINITIONS "${LLVM_DEFINITIONS} ${arg}")
+  endforeach(arg)
   add_definitions( ${ARGN} )
 endmacro(add_llvm_definitions)
 

Modified: llvm/trunk/tools/llvm-config/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-config/CMakeLists.txt?rev=124399&r1=124398&r2=124399&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-config/CMakeLists.txt (original)
+++ llvm/trunk/tools/llvm-config/CMakeLists.txt Thu Jan 27 13:29:48 2011
@@ -92,6 +92,17 @@
 set(CXX_FLGS "${CMAKE_CXX_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}")
 set(CPP_FLGS "${CMAKE_CPP_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}")
 
+# We don't want certain flags on the output of
+# llvm-config --cflags --cxxflags
+macro(remove_option_from_llvm_config option)
+  llvm_replace_compiler_option(C_FLGS "${option}" "")
+  llvm_replace_compiler_option(CXX_FLGS "${option}" "")
+  llvm_replace_compiler_option(CPP_FLGS "${option}" "")
+endmacro(remove_option_from_llvm_config)
+remove_option_from_llvm_config("-pedantic")
+remove_option_from_llvm_config("-Wall")
+remove_option_from_llvm_config("-W")
+
 add_custom_command(OUTPUT ${LLVM_CONFIG}
   COMMAND echo 's!@LLVM_CPPFLAGS@!${CPP_FLGS}!' > temp.sed
   COMMAND echo 's!@LLVM_CFLAGS@!${C_FLGS}!' >> temp.sed





More information about the llvm-commits mailing list