diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-11-23 09:10:12 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-11-23 09:10:12 +0000 |
commit | 0677cd445197fa1ea202b276561b735c903f8c50 (patch) | |
tree | 52a508dc11c38f7120a1da16965d97352b4a282d /CMakeLists.txt | |
parent | 70e79ce3e6885074a22d1526d9a2bfbbb6e5a5ea (diff) | |
download | rspamd-0677cd445197fa1ea202b276561b735c903f8c50.tar.gz rspamd-0677cd445197fa1ea202b276561b735c903f8c50.zip |
Test for atomic ops.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index c5e762567..01d7d940b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -146,6 +146,7 @@ INCLUDE(CheckIncludeFiles) INCLUDE(CheckFunctionExists) INCLUDE(CheckSymbolExists) INCLUDE(CheckCSourceCompiles) +INCLUDE(CheckCSourceRuns) INCLUDE(CheckLibraryExists) INCLUDE(CheckCCompilerFlag) INCLUDE(CMakeParseArguments) @@ -921,6 +922,16 @@ CHECK_C_SOURCE_COMPILES ("#include <sys/types.h> }" HAVE_ASM_PAUSE) ENDIF(NOT CMAKE_SYSTEM_NAME STREQUAL "SunOS") +CHECK_C_SOURCE_RUNS(" +int main(int argc, char **argv) { + int a = 0; + if (__sync_bool_compare_and_swap(&a, 0, 1)) { + return 0; + } + return -1; +} +" HAVE_ATOMIC_BUILTINS) + # Check queue.h compatibility IF(NOT HAVE_COMPATIBLE_QUEUE_H) INCLUDE_DIRECTORIES(compat) @@ -1038,6 +1049,7 @@ ADD_SUBDIRECTORY(utils) CONFIGURE_FILE(config.h.in src/config.h) +ADD_DEFINITIONS("HAVE_CONFIG_H") ##################### INSTALLATION ########################################## |