summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLouis Dionne <ldionne@apple.com>2019-07-05 17:06:23 +0000
committerLouis Dionne <ldionne@apple.com>2019-07-05 17:06:23 +0000
commit3e5ac5b3969c9b9f14828b1410127ac9747a4211 (patch)
tree9b12e8076056d71fbb269ad8963267c3cd66beb7
parent825410b0829d1c690b5c14118a589a1267db42cf (diff)
[libc++] Do not cleverly link against libc++abi just because it happens to be there
Summary: Otherwise, when libcxxabi is not an enabled project in the monorepo, we get a link error because we try to link against non-existent cxxabi_shared. More generally, we shouldn't change the behavior of the build based on implicit things like whether a file happens to be at a specific path or not. Reviewers: EricWF Subscribers: mgorny, christof, jkorous, dexonsmith, libcxx-commits Tags: #libc Differential Revision: https://reviews.llvm.org/D63883 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@365222 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--CMakeLists.txt13
-rw-r--r--cmake/Modules/HandleLibCXXABI.cmake2
2 files changed, 1 insertions, 14 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4a7d94549..4c1e3abdd 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -149,22 +149,9 @@ set_property(CACHE LIBCXX_CXX_ABI PROPERTY STRINGS ;${CXXABIS})
# Setup the default options if LIBCXX_CXX_ABI is not specified.
if (LIBCXX_CXX_ABI STREQUAL "default")
- find_path(
- LIBCXX_LIBCXXABI_INCLUDES_INTERNAL cxxabi.h
- PATHS ${LLVM_MAIN_SRC_DIR}/projects/libcxxabi/include
- ${LLVM_MAIN_SRC_DIR}/runtimes/libcxxabi/include
- ${LLVM_MAIN_SRC_DIR}/../libcxxabi/include
- NO_DEFAULT_PATH
- NO_CMAKE_FIND_ROOT_PATH
- )
if (LIBCXX_TARGETING_MSVC)
# FIXME: Figure out how to configure the ABI library on Windows.
set(LIBCXX_CXX_ABI_LIBNAME "vcruntime")
- elseif ((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)
set(LIBCXX_CXX_ABI_LIBNAME "libcxxabi")
set(LIBCXX_CXX_ABI_SYSTEM 1)
diff --git a/cmake/Modules/HandleLibCXXABI.cmake b/cmake/Modules/HandleLibCXXABI.cmake
index 10f100f7f..57f9e32c5 100644
--- a/cmake/Modules/HandleLibCXXABI.cmake
+++ b/cmake/Modules/HandleLibCXXABI.cmake
@@ -98,7 +98,7 @@ if ("${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "libstdc++" OR
"${_LIBSUPCXX_LIBNAME}" "${_LIBSUPCXX_LIBNAME}" "${_LIBSUPCXX_INCLUDE_FILES}" "bits"
)
elseif ("${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "libcxxabi")
- if (LIBCXX_CXX_ABI_INTREE)
+ if (TARGET cxxabi_shared AND TARGET cxxabi_static)
# Link against just-built "cxxabi" target.
set(CXXABI_SHARED_LIBNAME cxxabi_shared)
set(CXXABI_STATIC_LIBNAME cxxabi_static)