diff options
author | Petr Hosek <phosek@chromium.org> | 2018-07-15 03:05:20 +0000 |
---|---|---|
committer | Petr Hosek <phosek@chromium.org> | 2018-07-15 03:05:20 +0000 |
commit | fd78449c84a72de20cf1646cf706af84f943e64f (patch) | |
tree | 347ae2e161d2f15a3a812594d3cb53604727ceb2 /CMakeLists.txt | |
parent | bea00ccdf28bfd0f2773a09b0e429f7f6b54c0c9 (diff) |
[CMake] Change the flag to use compiler-rt builtins to boolean
This changes the name and the type to what it was prior to r333037
which matches the name of the flag used in other runtimes: libc++,
libc++abi and libunwind. We don't need the type to be a string since
there's only binary choice between libgcc and compiler-rt unlike in
the case of C++ library where there're multiple options.
Differential Revision: https://reviews.llvm.org/D49325
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@337116 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 6c2b5bb17..86ca2b3ef 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -157,17 +157,14 @@ else() set(SANITIZER_CXX_ABI_SYSTEM 1) endif() -set(COMPILER_RT_RUNTIME "default" CACHE STRING - "Compiler runtime to use.") - -if (COMPILER_RT_RUNTIME STREQUAL "default") - if (FUCHSIA) - set(COMPILER_RT_RUNTIME_LIBRARY "builtins") - endif() -else() - set(COMPILER_RT_RUNTIME_LIBRARY "${COMPILER_RT_RUNTIME}") +set(DEFAULT_COMPILER_RT_USE_BUILTINS_LIBRARY OFF) +if (FUCHSIA) + set(DEFAULT_COMPILER_RT_USE_BUILTINS_LIBRARY ON) endif() +option(COMPILER_RT_USE_BUILTINS_LIBRARY + "Use compiler-rt builtins instead of libgcc" ${DEFAULT_COMPILER_RT_USE_BUILTINS_LIBRARY}) + include(config-ix) #================================ @@ -316,7 +313,7 @@ append_list_if(COMPILER_RT_HAS_WD4800_FLAG /wd4800 SANITIZER_COMMON_CFLAGS) # Set common link flags. append_list_if(COMPILER_RT_HAS_NODEFAULTLIBS_FLAG -nodefaultlibs SANITIZER_COMMON_LINK_FLAGS) -if (COMPILER_RT_RUNTIME_LIBRARY STREQUAL "builtins") +if (COMPILER_RT_USE_BUILTINS_LIBRARY) list(APPEND SANITIZER_COMMON_LINK_LIBS ${COMPILER_RT_BUILTINS_LIBRARY}) else() if (ANDROID) |