diff options
author | Petr Hosek <phosek@chromium.org> | 2018-11-14 00:09:26 +0000 |
---|---|---|
committer | Petr Hosek <phosek@chromium.org> | 2018-11-14 00:09:26 +0000 |
commit | 464a1af3c042a2ce083b139d8b338936f08fad8b (patch) | |
tree | b4b04a75da4a0701863c92639d0fa5875e3cc84b /libunwind | |
parent | aa80c4564b80865398ff9f3da6574cacc6f3d968 (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 'libunwind')
-rw-r--r-- | libunwind/cmake/Modules/HandleCompilerRT.cmake | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libunwind/cmake/Modules/HandleCompilerRT.cmake b/libunwind/cmake/Modules/HandleCompilerRT.cmake index 275243a1bc6..77168e59946 100644 --- a/libunwind/cmake/Modules/HandleCompilerRT.cmake +++ b/libunwind/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(LIBUNWIND_CXX_FLAGS CACHE CMAKE_CXX_FLAGS PROPERTY VALUE) + string(REPLACE " " ";" LIBUNWIND_CXX_FLAGS "${LIBUNWIND_CXX_FLAGS}") + list(APPEND CLANG_COMMAND ${LIBUNWIND_CXX_FLAGS}) execute_process( COMMAND ${CLANG_COMMAND} RESULT_VARIABLE HAD_ERROR |