llvm.org GIT mirror llvm / d73e575
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124399 91177308-0d34-0410-b5e6-96231b3b80d8 Oscar Fuentes 8 years ago
2 changed file(s) with 15 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
44 # Beware that there is no implementation of remove_llvm_definitions.
55
66 macro(add_llvm_definitions)
7 set(LLVM_DEFINITIONS "${LLVM_DEFINITIONS} ${ARGN}")
7 # We don't want no semicolons on LLVM_DEFINITIONS:
8 foreach(arg ${ARGN})
9 set(LLVM_DEFINITIONS "${LLVM_DEFINITIONS} ${arg}")
10 endforeach(arg)
811 add_definitions( ${ARGN} )
912 endmacro(add_llvm_definitions)
1013
9191 set(CXX_FLGS "${CMAKE_CXX_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}")
9292 set(CPP_FLGS "${CMAKE_CPP_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}")
9393
94 # We don't want certain flags on the output of
95 # llvm-config --cflags --cxxflags
96 macro(remove_option_from_llvm_config option)
97 llvm_replace_compiler_option(C_FLGS "${option}" "")
98 llvm_replace_compiler_option(CXX_FLGS "${option}" "")
99 llvm_replace_compiler_option(CPP_FLGS "${option}" "")
100 endmacro(remove_option_from_llvm_config)
101 remove_option_from_llvm_config("-pedantic")
102 remove_option_from_llvm_config("-Wall")
103 remove_option_from_llvm_config("-W")
104
94105 add_custom_command(OUTPUT ${LLVM_CONFIG}
95106 COMMAND echo 's!@LLVM_CPPFLAGS@!${CPP_FLGS}!' > temp.sed
96107 COMMAND echo 's!@LLVM_CFLAGS@!${C_FLGS}!' >> temp.sed