aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorHanspeter Portner <dev@open-music-kontrollers.ch>2015-12-10 14:47:33 +0100
committerHanspeter Portner <dev@open-music-kontrollers.ch>2015-12-10 14:47:33 +0100
commitcf848e674b1bfdc88fe8b7987889772ebfcf5927 (patch)
tree38096cb6a2e173ee5ac568c1d54b1c7419e94a07 /CMakeLists.txt
parent041fd3e603aa1d078d5927d9dc096d30de623de6 (diff)
downloadsynthpod-cf848e674b1bfdc88fe8b7987889772ebfcf5927.tar.xz
add cmake check for stdatomic support.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt18
1 files changed, 18 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e68a0cf1..dc0b6149 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -50,6 +50,24 @@ if(${CAN_VECTORIZE})
#set(CMAKE_C_FLAGS "-Rpass=loop-vectorize ${CMAKE_C_FLAGS}") # CLANG
endif()
+# atomic operations
+include(CheckCSourceCompiles)
+CHECK_C_SOURCE_COMPILES("
+ #include <stdlib.h>
+ #include <stdatomic.h>
+ int main(int argc, char **argv)
+ {
+ _Atomic size_t head;
+ atomic_init(&head, 0);
+ size_t chead = atomic_load_explicit(&head, memory_order_acquire);
+ chead += 1;
+ atomic_store_explicit(&head, chead, memory_order_release);
+ return 0;
+ }" HAS_ATOMIC)
+if(NOT ${HAS_ATOMIC})
+ message(FATAL_ERROR "compiler has no support for C11 atomic operations")
+endif()
+
# eina
pkg_search_module(EINA REQUIRED eina>=1.8)
include_directories(${EINA_INCLUDE_DIRS})