llvm.org GIT mirror llvm / 82b62b6
[CMake] Don't pass all LLVM_COMPILE_FLAGS to the C compiler GCC (unlike clang!) warns about C++ flags when compiling C. https://reviews.llvm.org/D67171 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371521 91177308-0d34-0410-b5e6-96231b3b80d8 David Zarzycki a month ago
1 changed file(s) with 8 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
66 if("${sources}" MATCHES "\\.c(;|$)")
77 set(update_src_props ON)
88 endif()
9
10 list(APPEND LLVM_COMPILE_CFLAGS " ${LLVM_COMPILE_FLAGS}")
911
1012 # LLVM_REQUIRES_EH is an internal flag that individual targets can use to
1113 # force EH
5355 # - LLVM_COMPILE_FLAGS is list.
5456 # - PROPERTY COMPILE_FLAGS is string.
5557 string(REPLACE ";" " " target_compile_flags " ${LLVM_COMPILE_FLAGS}")
58 string(REPLACE ";" " " target_compile_cflags " ${LLVM_COMPILE_CFLAGS}")
5659
5760 if(update_src_props)
5861 foreach(fn ${sources})
5962 get_filename_component(suf ${fn} EXT)
60 if("${suf}" STREQUAL ".cpp" OR "${suf}" STREQUAL ".c")
63 if("${suf}" STREQUAL ".cpp")
6164 set_property(SOURCE ${fn} APPEND_STRING PROPERTY
6265 COMPILE_FLAGS "${target_compile_flags}")
66 endif()
67 if("${suf}" STREQUAL ".c")
68 set_property(SOURCE ${fn} APPEND_STRING PROPERTY
69 COMPILE_FLAGS "${target_compile_cflags}")
6370 endif()
6471 endforeach()
6572 else()