summaryrefslogtreecommitdiff
path: root/lib/builtins/CMakeLists.txt
diff options
context:
space:
mode:
authorChris Bieneman <beanz@apple.com>2016-09-01 21:05:49 +0000
committerChris Bieneman <beanz@apple.com>2016-09-01 21:05:49 +0000
commit4d103fc73ec229737b7fb530cc1a6302422f7cf8 (patch)
tree96d5e335dd87cde767f4f65c589a97ecb98ef03b /lib/builtins/CMakeLists.txt
parent8ea9f132b2cc036817add97b8bceb70f63d147a0 (diff)
[CMake] Add option (defaulted off) to exclude atomic.c
The atomic builtin source is problematic when cross-compiling builtins because it requires a variable and sometimes large set of system headers. This option allows users to optionally prevent it from being built. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@280416 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/builtins/CMakeLists.txt')
-rw-r--r--lib/builtins/CMakeLists.txt6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/builtins/CMakeLists.txt b/lib/builtins/CMakeLists.txt
index a7d665e9c..9ea0ba0d7 100644
--- a/lib/builtins/CMakeLists.txt
+++ b/lib/builtins/CMakeLists.txt
@@ -164,7 +164,11 @@ set(GENERIC_SOURCES
umodsi3.c
umodti3.c)
-if(COMPILER_RT_HAS_ATOMIC_KEYWORD)
+option(COMPILER_RT_EXCLUDE_ATOMIC_BUILTIN
+ "Skip the atomic builtin (this may be needed if system headers are unavailable)"
+ Off)
+
+if(COMPILER_RT_HAS_ATOMIC_KEYWORD AND NOT COMPILER_RT_EXCLUDE_ATOMIC_BUILTIN)
set(GENERIC_SOURCES
${GENERIC_SOURCES}
atomic.c)