]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - opencl/llvm.git/commitdiff
Don't show -pedantic, -W and -Wall on the output of
authorOscar Fuentes <ofv@wanadoo.es>
Thu, 27 Jan 2011 19:29:48 +0000 (19:29 +0000)
committerOscar Fuentes <ofv@wanadoo.es>
Thu, 27 Jan 2011 19:29:48 +0000 (19:29 +0000)
llvm-config --cflags --cxxflags --cppflags

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124399 91177308-0d34-0410-b5e6-96231b3b80d8

cmake/modules/AddLLVMDefinitions.cmake
tools/llvm-config/CMakeLists.txt

index 0f6d81f736d514b5733220c7784fc5fad3390b5e..2787830bfa9dacf4f63256bf488afa6a1b09c82e 100644 (file)
@@ -5,7 +5,10 @@
 # Beware that there is no implementation of remove_llvm_definitions.\r
 \r
 macro(add_llvm_definitions)\r
-  set(LLVM_DEFINITIONS "${LLVM_DEFINITIONS} ${ARGN}")\r
+  # We don't want no semicolons on LLVM_DEFINITIONS:\r
+  foreach(arg ${ARGN})\r
+    set(LLVM_DEFINITIONS "${LLVM_DEFINITIONS} ${arg}")\r
+  endforeach(arg)\r
   add_definitions( ${ARGN} )\r
 endmacro(add_llvm_definitions)\r
 \r
index cf672a48691f37fa95508bb10f4f7781bb67cbf9..b9a833f7bbde2707887a31534798afe1e2a139e7 100644 (file)
@@ -92,6 +92,17 @@ set(C_FLGS "${CMAKE_C_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}")
 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