summaryrefslogtreecommitdiff
path: root/cmake/builtin-config-ix.cmake
diff options
context:
space:
mode:
authorChris Bieneman <beanz@apple.com>2016-08-12 01:29:26 +0000
committerChris Bieneman <beanz@apple.com>2016-08-12 01:29:26 +0000
commit8a22938e76396fcbe2fc174686322e6e2e874ad4 (patch)
tree02f65dad91da26b3cf9bf8cb62519289036c5032 /cmake/builtin-config-ix.cmake
parenta521e597b28e48210f08331f8368923d4f5c4203 (diff)
[CMake] If the compiler supports _Atomic include atomic.c in builtins libraries
This fixes a long-standing TODO by implementing a compiler check for supporting the _Atomic keyword. If the _Atomic keyword is supported by the compiler we should include it in the builtin library sources. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@278454 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake/builtin-config-ix.cmake')
-rw-r--r--cmake/builtin-config-ix.cmake10
1 files changed, 10 insertions, 0 deletions
diff --git a/cmake/builtin-config-ix.cmake b/cmake/builtin-config-ix.cmake
index 432b1fadb..83466d81b 100644
--- a/cmake/builtin-config-ix.cmake
+++ b/cmake/builtin-config-ix.cmake
@@ -1,4 +1,5 @@
include(BuiltinTests)
+include(CheckCSourceCompiles)
# Make all the tests only check the compiler
set(TEST_COMPILE_ONLY On)
@@ -14,6 +15,15 @@ builtin_check_c_compiler_flag(-mfloat-abi=soft COMPILER_RT_HAS_FLOAT_ABI_SO
builtin_check_c_compiler_flag(-mfloat-abi=hard COMPILER_RT_HAS_FLOAT_ABI_HARD_FLAG)
builtin_check_c_compiler_flag(-static COMPILER_RT_HAS_STATIC_FLAG)
+builtin_check_c_compiler_source(COMPILER_RT_SUPPORTS_ATOMIC_KEYWORD
+"
+int foo(int x, int y) {
+ _Atomic int result = x * y;
+ return result;
+}
+")
+
+
set(ARM64 aarch64)
set(ARM32 arm armhf)
set(X86 i386 i686)