summaryrefslogtreecommitdiff
path: root/libcxxabi
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
commit464a1af3c042a2ce083b139d8b338936f08fad8b (patch)
treeb4b04a75da4a0701863c92639d0fa5875e3cc84b /libcxxabi
parentaa80c4564b80865398ff9f3da6574cacc6f3d968 (diff)
[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
Diffstat (limited to 'libcxxabi')
-rw-r--r--libcxxabi/cmake/Modules/HandleCompilerRT.cmake3
1 files changed, 3 insertions, 0 deletions
diff --git a/libcxxabi/cmake/Modules/HandleCompilerRT.cmake b/libcxxabi/cmake/Modules/HandleCompilerRT.cmake
index 945de585058..1f953276df0 100644
--- a/libcxxabi/cmake/Modules/HandleCompilerRT.cmake
+++ b/libcxxabi/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