summaryrefslogtreecommitdiff
path: root/cmake/Modules
diff options
context:
space:
mode:
authorPetr Hosek <phosek@chromium.org>2018-11-03 01:38:26 +0000
committerPetr Hosek <phosek@chromium.org>2018-11-03 01:38:26 +0000
commitf2a8d8d02d6a077ce40381810ed5ffa0b7278e2f (patch)
tree38b0c5369fc750b38340e1acfae4f9c088a0b76a /cmake/Modules
parente19914db4f2a004b2d4939d33c0986dcd6ac7a78 (diff)
downloadcompiler-rt-f2a8d8d02d6a077ce40381810ed5ffa0b7278e2f.tar.gz
[compiler-rt] Support for passing through linker flags to libc++ build
This may be needed when cross-compiling to certain platforms. Differential Revision: https://reviews.llvm.org/D54027 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@346063 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake/Modules')
-rw-r--r--cmake/Modules/AddCompilerRT.cmake9
1 files changed, 7 insertions, 2 deletions
diff --git a/cmake/Modules/AddCompilerRT.cmake b/cmake/Modules/AddCompilerRT.cmake
index f6142f842..81b110203 100644
--- a/cmake/Modules/AddCompilerRT.cmake
+++ b/cmake/Modules/AddCompilerRT.cmake
@@ -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
@@ -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()