[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
Wed Jul 22 11:54:13 PDT 2020


ldionne updated this revision to Diff 279901.
ldionne added a comment.
Herald added a reviewer: libc++.

Rebase onto master now that we're on CMake 3.13


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.279901.patch
Type: text/x-patch
Size: 967 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20200722/a8a09d9b/attachment.bin>


More information about the libcxx-commits mailing list