diff options
author | Eric Fiselier <eric@efcs.ca> | 2014-10-18 02:19:28 +0000 |
---|---|---|
committer | Eric Fiselier <eric@efcs.ca> | 2014-10-18 02:19:28 +0000 |
commit | a38dd8aad27c6d15619ca6c4c83408975fe2361e (patch) | |
tree | 97e6f1aac1e5c946c1ada6e13fa4fab4592a8701 /libcxx/cmake | |
parent | 600f245b8ad49b259722fb7a6b6e26cac25a929c (diff) | |
download | bcm5719-llvm-a38dd8aad27c6d15619ca6c4c83408975fe2361e.tar.gz bcm5719-llvm-a38dd8aad27c6d15619ca6c4c83408975fe2361e.zip |
Add special case for finding the in-tree ABI library.
When libcxx is built in-tree with libcxxabi it links against libcxxabi using
the name of the cmake target and not the actual library name. The cmake target
will not work with `find_library()`, so it needs special case handling.
llvm-svn: 220121
Diffstat (limited to 'libcxx/cmake')
-rw-r--r-- | libcxx/cmake/Modules/HandleLibCXXABI.cmake | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/libcxx/cmake/Modules/HandleLibCXXABI.cmake b/libcxx/cmake/Modules/HandleLibCXXABI.cmake index c194d8aad3f..8a9f8632dcb 100644 --- a/libcxx/cmake/Modules/HandleLibCXXABI.cmake +++ b/libcxx/cmake/Modules/HandleLibCXXABI.cmake @@ -27,13 +27,20 @@ macro(setup_abi_lib abipathvar abidefines abilibs abifiles abidirs) # each run of find_library. set(LIBCXX_CXX_ABI_LIBRARIES "") foreach(alib ${abilibs}) - unset(_Res CACHE) - find_library(_Res ${alib}) - if (${_Res} STREQUAL "_Res-NOTFOUND") - message(FATAL_ERROR "Failed to find ABI library: ${alib}") + # cxxabi is a cmake target and not a library. + # Handle this special case explicitly. + # Otherwise use find_library to locate the correct binary. + if (alib STREQUAL "cxxabi") + list(APPEND LIBCXX_CXX_ABI_LIBRARIES cxxabi) else() - message(STATUS "Adding ABI library: ${_Res}") - list(APPEND LIBCXX_CXX_ABI_LIBRARIES ${_Res}) + unset(_Res CACHE) + find_library(_Res ${alib}) + if (${_Res} STREQUAL "_Res-NOTFOUND") + message(FATAL_ERROR "Failed to find ABI library: ${alib}") + else() + message(STATUS "Adding ABI library: ${_Res}") + list(APPEND LIBCXX_CXX_ABI_LIBRARIES ${_Res}) + endif() endif() endforeach() |