[libcxx-commits] [PATCH] D68880: [libc++] Use generator expression in Linker script generation

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jul 30 09:00:18 PDT 2020


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG0a00a7d57791: [libc++] Use generator expression in Linker script generation (authored by ldionne).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68880/new/

https://reviews.llvm.org/D68880

Files:
  libcxx/cmake/Modules/DefineLinkerScript.cmake


Index: libcxx/cmake/Modules/DefineLinkerScript.cmake
===================================================================
--- libcxx/cmake/Modules/DefineLinkerScript.cmake
+++ libcxx/cmake/Modules/DefineLinkerScript.cmake
@@ -34,13 +34,8 @@
       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}")


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68880.281950.patch
Type: text/x-patch
Size: 967 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20200730/659e1062/attachment-0001.bin>


More information about the libcxx-commits mailing list