[cfe-commits] [PATCH] [libcxx][CMake] Add initial support for selecting a specific c++ abi to use.

Michael Spencer bigcheesegs at gmail.com
Wed Nov 28 19:48:57 PST 2012


  I'll submit an updated patch tomorrow. No Linux machine atm.


================
Comment at: src/exception.cpp:44
@@ -43,3 +43,3 @@
 
-#if !defined(LIBCXXRT) && !defined(_LIBCPPABI_VERSION)
+#if !defined(LIBCXXRT) && !defined(_LIBCPPABI_VERSION) && !defined(__GLIBCXX__)
 
----------------
Chandler Carruth wrote:
> Why is this required? Separate commit?
It fails to link without these changes due to libsupc++ already defining these symbols. I suppose it could be a separate commit.

================
Comment at: lib/CMakeLists.txt:35
@@ -34,2 +34,3 @@
 # Generate library list.
+set(libraries ${LIBCXX_CXX_ABI_LIBRARIES})
 append_if(libraries LIBCXX_HAS_PTHREAD_LIB pthread)
----------------
Chandler Carruth wrote:
> Why not use append_if for each line? Was the old code just broken?
I'm not using append_if here because there's no conditional to test.

================
Comment at: CMakeLists.txt:79-92
@@ +78,16 @@
+  set(LIBCXX_LIBSUPCXX_FILE_PATHS)
+  foreach(file ${LIBCXX_LIBSUPCXX_FILES})
+    set(found FALSE)
+    foreach(incpath ${LIBCXX_LIBSUPCXX_INCLUDE_PATHS})
+      if (EXISTS "${incpath}/${file}")
+        set(found TRUE)
+        get_filename_component(dstdir ${file} PATH)
+        file(COPY "${incpath}/${file}"
+             DESTINATION "${CMAKE_BINARY_DIR}/include/${dstdir}")
+      endif()
+    endforeach()
+    if (NOT found)
+      message(FATAL_ERROR "Failed to find ${file}")
+    endif()
+  endforeach()
+  include_directories("${CMAKE_BINARY_DIR}/include")
----------------
Chandler Carruth wrote:
> This is really gross. It happens at cmake time, not at build time. =[ Is there a way to instead trigger this as part of the build? Notably, so it will re-copy of the source files change?
I could probably use add_custom_command with a dependency on the file.


http://llvm-reviews.chandlerc.com/D82



More information about the cfe-commits mailing list