summaryrefslogtreecommitdiffstats
path: root/compiler-rt/cmake/config-ix.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'compiler-rt/cmake/config-ix.cmake')
-rw-r--r--compiler-rt/cmake/config-ix.cmake9
1 files changed, 5 insertions, 4 deletions
diff --git a/compiler-rt/cmake/config-ix.cmake b/compiler-rt/cmake/config-ix.cmake
index 4a9d840b2e0..a61d92356d0 100644
--- a/compiler-rt/cmake/config-ix.cmake
+++ b/compiler-rt/cmake/config-ix.cmake
@@ -13,7 +13,10 @@ function(check_linker_flag flag out_var)
endfunction()
check_library_exists(c fopen "" COMPILER_RT_HAS_LIBC)
-if (NOT SANITIZER_USE_COMPILER_RT)
+if (COMPILER_RT_RUNTIME_LIBRARY STREQUAL "compiler-rt")
+ include(HandleCompilerRT)
+ find_compiler_rt_library(builtins COMPILER_RT_BUILTINS_LIBRARY)
+else()
if (ANDROID)
check_library_exists(gcc __gcc_personality_v0 "" COMPILER_RT_HAS_GCC_LIB)
else()
@@ -27,9 +30,7 @@ if (COMPILER_RT_HAS_NODEFAULTLIBS_FLAG)
if (COMPILER_RT_HAS_LIBC)
list(APPEND CMAKE_REQUIRED_LIBRARIES c)
endif ()
- if (SANITIZER_USE_COMPILER_RT)
- list(APPEND CMAKE_REQUIRED_FLAGS -rtlib=compiler-rt)
- find_compiler_rt_library(builtins COMPILER_RT_BUILTINS_LIBRARY)
+ if (COMPILER_RT_RUNTIME_LIBRARY STREQUAL "compiler-rt")
list(APPEND CMAKE_REQUIRED_LIBRARIES "${COMPILER_RT_BUILTINS_LIBRARY}")
elseif (COMPILER_RT_HAS_GCC_S_LIB)
list(APPEND CMAKE_REQUIRED_LIBRARIES gcc_s)
OpenPOWER on IntegriCloud