unwind: clean up warnings from the build

Now thta the build is split, clean up some of the warnings in the build:
  cc1: warning: command line option '-nostdinc++' is valid for C++/ObjC++ but not for C
  cc1: warning: command line option '-fno-rtti' is valid for C++/ObjC++ but not for C

Append the C++ specific flags specifically to the C++ sources.  Avoids the
spurious warnings due to invalid flags being passed during the compilation of
C++ sources.

llvm-svn: 235797
This commit is contained in:
Saleem Abdulrasool 2015-04-25 02:06:15 +00:00
parent 2ba9a21ad0
commit ea9c4fc75d
1 changed files with 4 additions and 1 deletions

View File

@ -65,7 +65,7 @@ target_link_libraries(unwind ${libraries})
# Setup flags.
append_if(LIBUNWIND_COMPILE_FLAGS LIBUNWIND_HAS_FPIC_FLAG -fPIC)
append_if(LIBUNWIND_COMPILE_FLAGS LIBUNWIND_HAS_NO_RTTI_FLAG -fno-rtti)
append_if(LIBUNWIND_CXX_FLAGS LIBUNWIND_HAS_NO_RTTI_FLAG -fno-rtti)
append_if(LIBUNWIND_LINK_FLAGS LIBUNWIND_HAS_NODEFAULTLIBS_FLAG -nodefaultlibs)
@ -93,6 +93,7 @@ if (APPLE)
endif ()
string(REPLACE ";" " " LIBUNWIND_COMPILE_FLAGS "${LIBUNWIND_COMPILE_FLAGS}")
string(REPLACE ";" " " LIBUNWIND_CXX_FLAGS "${LIBUNWIND_CXX_FLAGS}")
string(REPLACE ";" " " LIBUNWIND_LINK_FLAGS "${LIBUNWIND_LINK_FLAGS}")
set_target_properties(unwind
@ -102,6 +103,8 @@ set_target_properties(unwind
OUTPUT_NAME "unwind"
VERSION "1.0"
SOVERSION "1")
set_property(SOURCE ${LIBUNWIND_CXX_SOURCES}
APPEND_STRING PROPERTY COMPILE_FLAGS "${LIBUNWIND_CXX_FLAGS}")
install(TARGETS unwind
LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}