diff --git a/compiler-rt/cmake/Modules/HandleCompilerRT.cmake b/compiler-rt/cmake/Modules/HandleCompilerRT.cmake index 855d0ff9df1c..364cdccc84db 100644 --- a/compiler-rt/cmake/Modules/HandleCompilerRT.cmake +++ b/compiler-rt/cmake/Modules/HandleCompilerRT.cmake @@ -4,6 +4,9 @@ function(find_compiler_rt_library name variable) if (CMAKE_CXX_COMPILER_ID MATCHES Clang AND CMAKE_CXX_COMPILER_TARGET) list(APPEND CLANG_COMMAND "--target=${CMAKE_CXX_COMPILER_TARGET}") endif() + get_property(SANITIZER_CXX_FLAGS CACHE CMAKE_CXX_FLAGS PROPERTY VALUE) + string(REPLACE " " ";" SANITIZER_CXX_FLAGS "${SANITIZER_CXX_FLAGS}") + list(APPEND CLANG_COMMAND ${SANITIZER_CXX_FLAGS}) execute_process( COMMAND ${CLANG_COMMAND} RESULT_VARIABLE HAD_ERROR diff --git a/libcxx/cmake/Modules/HandleCompilerRT.cmake b/libcxx/cmake/Modules/HandleCompilerRT.cmake index 2e0e69e5e085..1ce256574941 100644 --- a/libcxx/cmake/Modules/HandleCompilerRT.cmake +++ b/libcxx/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(LIBCXX_CXX_FLAGS CACHE CMAKE_CXX_FLAGS PROPERTY VALUE) + string(REPLACE " " ";" LIBCXX_CXX_FLAGS "${LIBCXX_CXX_FLAGS}") + list(APPEND CLANG_COMMAND ${LIBCXX_CXX_FLAGS}) execute_process( COMMAND ${CLANG_COMMAND} RESULT_VARIABLE HAD_ERROR diff --git a/libcxxabi/cmake/Modules/HandleCompilerRT.cmake b/libcxxabi/cmake/Modules/HandleCompilerRT.cmake index 945de5850589..1f953276df00 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 diff --git a/libunwind/cmake/Modules/HandleCompilerRT.cmake b/libunwind/cmake/Modules/HandleCompilerRT.cmake index 275243a1bc6b..77168e599466 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