[PATCH] D54027: [compiler-rt] Support for passing through linker flags to libc++ build

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 2 18:40:49 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL346063: [compiler-rt] Support for passing through linker flags to libc++ build (authored by phosek, committed by ).
Herald added a subscriber: delcypher.

Changed prior to commit:
  https://reviews.llvm.org/D54027?vs=172316&id=172477#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D54027

Files:
  compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake


Index: compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake
===================================================================
--- compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake
+++ compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake
@@ -551,6 +551,9 @@
   set(PASSTHROUGH_VARIABLES
     CMAKE_C_COMPILER_TARGET
     CMAKE_CXX_COMPILER_TARGET
+    CMAKE_SHARED_LINKER_FLAGS
+    CMAKE_MODULE_LINKER_FLAGS
+    CMAKE_EXE_LINKER_FLAGS
     CMAKE_INSTALL_PREFIX
     CMAKE_MAKE_PROGRAM
     CMAKE_LINKER
@@ -563,8 +566,10 @@
     CMAKE_SYSROOT
     CMAKE_SYSTEM_NAME)
   foreach(variable ${PASSTHROUGH_VARIABLES})
-    if(${variable})
-      list(APPEND CMAKE_PASSTHROUGH_VARIABLES -D${variable}=${${variable}})
+    get_property(is_value_set CACHE ${variable} PROPERTY VALUE SET)
+    if(${is_value_set})
+      get_property(value CACHE ${variable} PROPERTY VALUE)
+      list(APPEND CMAKE_PASSTHROUGH_VARIABLES -D${variable}=${value})
     endif()
   endforeach()
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54027.172477.patch
Type: text/x-patch
Size: 970 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181103/f97eeabd/attachment.bin>


More information about the llvm-commits mailing list