[libc++] Try to fix Chromium's build
authorLouis Dionne <ldionne@apple.com>
Thu, 2 Apr 2020 17:11:50 +0000 (13:11 -0400)
committerLouis Dionne <ldionne@apple.com>
Thu, 2 Apr 2020 17:15:30 +0000 (13:15 -0400)
Chromium's build sets LIBCXX_CXX_ABI_SYSTEM explicitly when building
libc++, which was broken by 61e89737c5da (which stopped listening to
that option). As a workaround, this commit uses the system libc++abi
when LIBCXX_CXX_ABI_SYSTEM is used.

However, we will need to work with Chromium to standardize their build
of libc++, because LIBCXX_CXX_ABI_SYSTEM is not a public facing build
configuration for libc++, and has never been AFAICT.

libcxx/cmake/Modules/HandleLibCXXABI.cmake

index a62efc0..f5d15f8 100644 (file)
@@ -104,7 +104,7 @@ if ("${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "libstdc++" OR
 elseif ("${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "libcxxabi")
   set(LIBCXX_CXX_ABI_INCLUDE_PATHS "${LIBCXX_SOURCE_DIR}/../libcxxabi/include")
 
-  if(LIBCXX_STANDALONE_BUILD AND NOT (LIBCXX_CXX_ABI_INTREE OR HAVE_LIBCXXABI))
+  if((LIBCXX_CXX_ABI_SYSTEM OR LIBCXX_STANDALONE_BUILD) AND NOT (LIBCXX_CXX_ABI_INTREE OR HAVE_LIBCXXABI))
     set(shared c++abi)
     set(static c++abi)
   else()