From 0a00a7d57791e2bf2a5c86c09dbfb52aac57862d Mon Sep 17 00:00:00 2001 From: Louis Dionne Date: Fri, 11 Oct 2019 14:42:26 -0400 Subject: [PATCH] [libc++] Use generator expression in Linker script generation This is an alternative to the workaround in 34a3b24a90c6. Differential Revision: https://reviews.llvm.org/D68880 --- libcxx/cmake/Modules/DefineLinkerScript.cmake | 9 ++------- 1 file 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}$") - else() - list(APPEND link_libraries "${CMAKE_LINK_LIBRARY_FLAG}${lib}") - endif() + set(libname "$,$,${lib}>") + list(APPEND link_libraries "${CMAKE_LINK_LIBRARY_FLAG}${libname}") endforeach() endif() string(REPLACE ";" " " link_libraries "${link_libraries}")