summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetr Hosek <phosek@chromium.org>2018-11-14 00:09:26 +0000
committerPetr Hosek <phosek@chromium.org>2018-11-14 00:09:26 +0000
commit1a9753522f1ae8d72848d365902f39e0d3d59a39 (patch)
tree6e9dd2d2ef0a0fa56ebbe6fbf66e65d9f1c2fdb5
parent3591960d573d96b352c372b14f50af2ace54240e (diff)
downloadlibcxxabi-1a9753522f1ae8d72848d365902f39e0d3d59a39.tar.gz
[CMake] Passthrough CFLAGS when checking the compiler-rt path
This is needed when cross-compiling for a different target since CFLAGS may contain additional flags like -resource-dir which change the location in which compiler-rt builtins are found. Differential Revision: https://reviews.llvm.org/D54371 git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@346820 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--cmake/Modules/HandleCompilerRT.cmake3
1 files changed, 3 insertions, 0 deletions
diff --git a/cmake/Modules/HandleCompilerRT.cmake b/cmake/Modules/HandleCompilerRT.cmake
index 945de58..1f95327 100644
--- a/cmake/Modules/HandleCompilerRT.cmake
+++ b/cmake/Modules/HandleCompilerRT.cmake
@@ -8,6 +8,9 @@ function(find_compiler_rt_library name dest)
if (CMAKE_CXX_COMPILER_ID MATCHES Clang AND CMAKE_CXX_COMPILER_TARGET)
list(APPEND CLANG_COMMAND "--target=${CMAKE_CXX_COMPILER_TARGET}")
endif()
+ get_property(LIBCXXABI_CXX_FLAGS CACHE CMAKE_CXX_FLAGS PROPERTY VALUE)
+ string(REPLACE " " ";" LIBCXXABI_CXX_FLAGS "${LIBCXXABI_CXX_FLAGS}")
+ list(APPEND CLANG_COMMAND ${LIBCXXABI_CXX_FLAGS})
execute_process(
COMMAND ${CLANG_COMMAND}
RESULT_VARIABLE HAD_ERROR