[libc++] Fix linker script generation

Handle the case when libc++abi and libunwind are being built together
with libc++ in the runtimes build. This logic was used in the previous
implementation but dropped in r374116.

Differential Revision: https://reviews.llvm.org/D68791

llvm-svn: 374510
This commit is contained in:
Petr Hosek 2019-10-11 04:54:35 +00:00
parent ccc85ac855
commit 34a3b24a90
1 changed files with 3 additions and 1 deletions

View File

@ -31,7 +31,9 @@ function(define_linker_script target)
set(link_libraries)
if (interface_libs)
foreach(lib IN LISTS interface_libs)
if (TARGET "${lib}")
if (TARGET "${lib}" OR
(${lib} MATCHES "cxxabi(_static|_shared)?" AND HAVE_LIBCXXABI) OR
(${lib} MATCHES "unwind(_static|_shared)?" AND HAVE_LIBUNWIND))
list(APPEND link_libraries "${CMAKE_LINK_LIBRARY_FLAG}$<TARGET_PROPERTY:${lib},OUTPUT_NAME>")
else()
list(APPEND link_libraries "${CMAKE_LINK_LIBRARY_FLAG}${lib}")