Correctly default to using the system libc++abi on Apple.

This patch fixes a regression where libc++ didn't correctly
select the system libc++abi when no in-tree version was found.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294712 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Fiselier 2017-02-10 05:07:03 +00:00
parent d60b66ad4f
commit 801e00b0cd
2 changed files with 8 additions and 11 deletions

View File

@ -116,23 +116,18 @@ if (LIBCXX_CXX_ABI STREQUAL "default")
${LLVM_MAIN_SRC_DIR}/runtimes/libcxxabi/include
NO_DEFAULT_PATH
)
find_path(
LIBCXX_LIBCXXABI_INCLUDES_EXTERNAL
cxxabi.h
PATHS /usr/include
)
if ((NOT LIBCXX_STANDALONE_BUILD OR HAVE_LIBCXXABI) AND
IS_DIRECTORY "${LIBCXX_LIBCXXABI_INCLUDES_INTERNAL}")
set(LIBCXX_CXX_ABI_LIBNAME "libcxxabi")
set(LIBCXX_CXX_ABI_INCLUDE_PATHS "${LIBCXX_LIBCXXABI_INCLUDES_INTERNAL}")
set(LIBCXX_CXX_ABI_INTREE 1)
elseif(APPLE AND IS_DIRECTORY "${LIBCXX_LIBCXXABI_INCLUDES_INTERNAL}")
set(LIBCXX_CXX_ABI_LIBNAME "libcxxabi")
set(LIBCXX_CXX_ABI_INCLUDE_PATHS "${LIBCXX_LIBCXXABI_INCLUDES_INTERNAL}")
else()
if (LIBCXX_TARGETING_MSVC)
# FIXME: Figure out how to configure the ABI library on Windows.
set(LIBCXX_CXX_ABI_LIBNAME "vcruntime")
elseif(APPLE)
set(LIBCXX_CXX_ABI_LIBNAME "libcxxabi")
set(LIBCXX_CXX_ABI_SYSTEM 1)
else()
set(LIBCXX_CXX_ABI_LIBNAME "default")
endif()

View File

@ -103,9 +103,11 @@ elseif ("${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "libcxxabi")
# Assume c++abi is installed in the system, rely on -lc++abi link flag.
set(CXXABI_LIBNAME "c++abi")
endif()
setup_abi_lib("-DLIBCXX_BUILDING_LIBCXXABI"
${CXXABI_LIBNAME} "cxxabi.h;__cxxabi_config.h" ""
)
set(HEADERS "cxxabi.h;__cxxabi_config.h")
if (LIBCXX_CXX_ABI_SYSTEM)
set(HEADERS "")
endif()
setup_abi_lib("-DLIBCXX_BUILDING_LIBCXXABI" ${CXXABI_LIBNAME} "${HEADERS}" "")
elseif ("${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "libcxxrt")
setup_abi_lib("-DLIBCXXRT"
"cxxrt" "cxxabi.h;unwind.h;unwind-arm.h;unwind-itanium.h" ""