[libcxxabi] r228665 - unwind: improve compilation on Linux with gcc

Saleem Abdulrasool compnerd at compnerd.org
Mon Feb 9 19:43:33 PST 2015


Author: compnerd
Date: Mon Feb  9 21:43:33 2015
New Revision: 228665

URL: http://llvm.org/viewvc/llvm-project?rev=228665&view=rev
Log:
unwind: improve compilation on Linux with gcc

gcc still defaults to C89 which does not support BCPL style comments.  This
splits up the sources list in CMakeLists and selectively adds compile flags for
using C99 which avoids a number of warnings in -Wpedantic mode.  NFC.

Modified:
    libcxxabi/trunk/src/Unwind/CMakeLists.txt

Modified: libcxxabi/trunk/src/Unwind/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/Unwind/CMakeLists.txt?rev=228665&r1=228664&r2=228665&view=diff
==============================================================================
--- libcxxabi/trunk/src/Unwind/CMakeLists.txt (original)
+++ libcxxabi/trunk/src/Unwind/CMakeLists.txt Mon Feb  9 21:43:33 2015
@@ -1,20 +1,24 @@
 # Get sources
-set(LIBUNWIND_SOURCES
-  libunwind.cpp
-  Unwind-EHABI.cpp
-  UnwindLevel1.c
-  UnwindLevel1-gcc-ext.c
-  Unwind-sjlj.c
-)
 
-append_if(LIBUNWIND_SOURCES APPLE Unwind_AppleExtras.cpp)
+set(LIBUNWIND_CXX_SOURCES
+    libunwind.cpp
+    Unwind-EHABI.cpp)
+append_if(LIBUNWIND_CXX_SOURCES APPLE Unwind_AppleExtras.cpp)
+
+set(LIBUNWIND_C_SOURCES
+    UnwindLevel1.c
+    UnwindLevel1-gcc-ext.c
+    Unwind-sjlj.c)
+set_source_files_properties(${LIBUNWIND_C_SOURCES}
+                            PROPERTIES
+                              COMPILE_FLAGS "-std=c99")
 
 set(LIBUNWIND_ASM_SOURCES
-  UnwindRegistersRestore.S
-  UnwindRegistersSave.S
-)
-
-set_source_files_properties(${LIBUNWIND_ASM_SOURCES} PROPERTIES LANGUAGE C)
+    UnwindRegistersRestore.S
+    UnwindRegistersSave.S)
+set_source_files_properties(${LIBUNWIND_ASM_SOURCES}
+                            PROPERTIES
+                              LANGUAGE C)
 
 set(LIBUNWIND_HEADERS
   AddressSpace.hpp
@@ -40,18 +44,15 @@ if (MSVC_IDE)
   source_group("Header Files" FILES ${LIBUNWIND_HEADERS})
 endif()
 
+set(LIBUNWIND_SOURCES
+    ${LIBUNWIND_CXX_SOURCES}
+    ${LIBUNWIND_C_SOURCES}
+    ${LIBUNWIND_ASM_SOURCES})
+
 if (LIBUNWIND_ENABLE_SHARED)
-  add_library(unwind SHARED
-    ${LIBUNWIND_SOURCES}
-    ${LIBUNWIND_ASM_SOURCES}
-    ${LIBUNWIND_HEADERS}
-    )
+  add_library(unwind SHARED ${LIBUNWIND_SOURCES} ${LIBUNWIND_HEADERS})
 else()
-  add_library(unwind STATIC
-    ${LIBUNWIND_SOURCES}
-    ${LIBUNWIND_ASM_SOURCES}
-    ${LIBUNWIND_HEADERS}
-    )
+  add_library(unwind STATIC ${LIBUNWIND_SOURCES} ${LIBUNWIND_HEADERS})
 endif()
 
 include_directories("${LIBCXXABI_LIBCXX_INCLUDES}")





More information about the cfe-commits mailing list