diff options
author | Petr Hosek <phosek@chromium.org> | 2018-05-17 23:50:35 +0000 |
---|---|---|
committer | Petr Hosek <phosek@chromium.org> | 2018-05-17 23:50:35 +0000 |
commit | abcaa923f16eb45c8a9a450d783c7bc01c36b267 (patch) | |
tree | 5c0a6966c47000b8a7cf2487d52aa650e2c966f0 /cmake/Modules/CompilerRTUtils.cmake | |
parent | 313baf68df116ba3fff8c94ad7d339a78ba67d46 (diff) |
[CMake] Reland "Make simple source used for CMake checks a C file"
The source being compiled is plain C, but using .cc extension forces it
to be compiled as C++ which requires a working C++ compiler including
C++ library which may not be the case when we're building compiler-rt
together with libcxx as part of runtimes build.
Differential Revision: https://reviews.llvm.org/D47031
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@332679 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake/Modules/CompilerRTUtils.cmake')
-rw-r--r-- | cmake/Modules/CompilerRTUtils.cmake | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/cmake/Modules/CompilerRTUtils.cmake b/cmake/Modules/CompilerRTUtils.cmake index f567202fa..7ef1fc8d9 100644 --- a/cmake/Modules/CompilerRTUtils.cmake +++ b/cmake/Modules/CompilerRTUtils.cmake @@ -144,8 +144,12 @@ macro(test_target_arch arch def) endif() set(SAVED_CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS}) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${argstring}") + if(SANITIZER_CXX_ABI_SYSTEM) + set(FLAG_LINK_LIBRARIES ${SANITIZER_CXX_ABI_LIBRARY}) + endif() try_compile(CAN_TARGET_${arch} ${CMAKE_BINARY_DIR} ${SIMPLE_SOURCE} COMPILE_DEFINITIONS "${TARGET_${arch}_CFLAGS} ${FLAG_NO_EXCEPTIONS}" + LINK_LIBRARIES ${FLAG_LINK_LIBRARIES} OUTPUT_VARIABLE TARGET_${arch}_OUTPUT) set(CMAKE_EXE_LINKER_FLAGS ${SAVED_CMAKE_EXE_LINKER_FLAGS}) endif() |