Skip to content

Commit

Permalink
[compiler-rt] Support for passing through linker flags to libc++ build
Browse files Browse the repository at this point in the history
This may be needed when cross-compiling to certain platforms.

Differential Revision: https://reviews.llvm.org/D54027

llvm-svn: 346063
  • Loading branch information
petrhosek committed Nov 3, 2018
1 parent 2bcb288 commit 4dc4d6e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions compiler-rt/cmake/Modules/AddCompilerRT.cmake
Expand Up @@ -551,6 +551,9 @@ macro(add_custom_libcxx name prefix)
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
Expand All @@ -563,8 +566,10 @@ macro(add_custom_libcxx name prefix)
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()

Expand Down

0 comments on commit 4dc4d6e

Please sign in to comment.