[libc++abi] Ensure custom libc++ header paths are honoured during libc++abi build
authorLouis Dionne <ldionne@apple.com>
Mon, 15 Jun 2020 17:20:04 +0000 (13:20 -0400)
committerLouis Dionne <ldionne@apple.com>
Mon, 15 Jun 2020 17:22:51 +0000 (13:22 -0400)
This is necessary for standalone builds where the libc++ in use has a
custom configuration set up inside __config_site -- one needs to build
libc++abi against the installed headers of libc++ (which are properly
configured) instead of the ones inside libcxx/include.

See https://reviews.llvm.org/rGe619e9d#927848 for details.

libcxxabi/CMakeLists.txt

index d4ffcf8..08bc8dc 100644 (file)
@@ -126,13 +126,11 @@ if (NOT LIBCXXABI_ENABLE_SHARED AND NOT LIBCXXABI_ENABLE_STATIC)
   message(FATAL_ERROR "libc++abi must be built as either a shared or static library.")
 endif()
 
-set(LIBCXXABI_LIBCXX_PATH "${CMAKE_CURRENT_LIST_DIR}/../libcxx")
-set(LIBCXXABI_LIBCXX_INCLUDES "${LIBCXXABI_LIBCXX_PATH}/include")
-
 set(LIBCXXABI_LIBCXX_PATH "${CMAKE_CURRENT_LIST_DIR}/../libcxx" CACHE PATH
-    "Specify path to libc++ source." FORCE)
+    "Specify path to libc++ source.")
 set(LIBCXXABI_LIBCXX_INCLUDES "${LIBCXXABI_LIBCXX_PATH}/include" CACHE PATH
-    "Specify path to libc++ includes." FORCE)
+    "Specify path to libc++ includes.")
+message(STATUS "Libc++abi will be using libc++ includes from ${LIBCXXABI_LIBCXX_INCLUDES}")
 
 option(LIBCXXABI_HERMETIC_STATIC_LIBRARY
   "Do not export any symbols from the static library." OFF)