summaryrefslogtreecommitdiff
path: root/libcxx/cmake/Modules
diff options
context:
space:
mode:
authorLouis Dionne <ldionne@apple.com>2019-10-11 14:42:26 -0400
committerLouis Dionne <ldionne@apple.com>2020-07-30 11:59:29 -0400
commit0a00a7d57791e2bf2a5c86c09dbfb52aac57862d (patch)
tree25ec8c3e85b71cbcfa79323b9ac5e742e57b5dbd /libcxx/cmake/Modules
parent6a043ecc0cf4d257d06c4fe0c3d5e1d9a8c7ea94 (diff)
[libc++] Use generator expression in Linker script generation
This is an alternative to the workaround in 34a3b24a90c6. Differential Revision: https://reviews.llvm.org/D68880
Diffstat (limited to 'libcxx/cmake/Modules')
-rw-r--r--libcxx/cmake/Modules/DefineLinkerScript.cmake9
1 files changed, 2 insertions, 7 deletions
diff --git a/libcxx/cmake/Modules/DefineLinkerScript.cmake b/libcxx/cmake/Modules/DefineLinkerScript.cmake
index 11a6ca57dfc0..41426bf06714 100644
--- a/libcxx/cmake/Modules/DefineLinkerScript.cmake
+++ b/libcxx/cmake/Modules/DefineLinkerScript.cmake
@@ -34,13 +34,8 @@ function(define_linker_script target)
if ("${lib}" STREQUAL "cxx-headers")
continue()
endif()
- 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}")
- endif()
+ set(libname "$<IF:$<TARGET_EXISTS:${lib}>,$<TARGET_PROPERTY:${lib},OUTPUT_NAME>,${lib}>")
+ list(APPEND link_libraries "${CMAKE_LINK_LIBRARY_FLAG}${libname}")
endforeach()
endif()
string(REPLACE ";" " " link_libraries "${link_libraries}")