aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorMarat Dukhan <maratek@google.com>2019-10-19 00:14:10 -0700
committerMarat Dukhan <maratek@google.com>2019-10-19 00:14:10 -0700
commit71aacd31d8f0851a158a30df6129416d6f2eca17 (patch)
tree95d74f046d6201ac9968318aed6022381655af7a /CMakeLists.txt
parent158098ac36d257bedd7d9c02d7276eb8b2077881 (diff)
downloadpthreadpool-71aacd31d8f0851a158a30df6129416d6f2eca17.tar.gz
Switch to C11 atomics to synchronization
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt18
1 files changed, 6 insertions, 12 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0622cb9..2cdc2cb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,4 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12 FATAL_ERROR)
+CMAKE_MINIMUM_REQUIRED(VERSION 3.5 FATAL_ERROR)
INCLUDE(GNUInstallDirs)
@@ -16,16 +16,10 @@ IF(PTHREADPOOL_BUILD_TESTS)
ENABLE_TESTING()
ENDIF()
-MACRO(PTHREADPOOL_TARGET_ENABLE_C99 target)
- IF(${CMAKE_VERSION} VERSION_LESS "3.1")
- IF(NOT MSVC)
- TARGET_COMPILE_OPTIONS(${target} PRIVATE -std=c99)
- ENDIF()
- ELSE()
- SET_TARGET_PROPERTIES(${target} PROPERTIES
- C_STANDARD 99
- C_EXTENSIONS NO)
- ENDIF()
+MACRO(PTHREADPOOL_TARGET_ENABLE_C11 target)
+ SET_TARGET_PROPERTIES(${target} PROPERTIES
+ C_STANDARD 11
+ C_EXTENSIONS NO)
ENDMACRO()
# ---[ Download deps
@@ -91,7 +85,7 @@ ELSE()
MESSAGE(FATAL_ERROR "Unsupported library type ${PTHREADPOOL_LIBRARY_TYPE}")
ENDIF()
-PTHREADPOOL_TARGET_ENABLE_C99(pthreadpool)
+PTHREADPOOL_TARGET_ENABLE_C11(pthreadpool)
TARGET_LINK_LIBRARIES(pthreadpool PUBLIC pthreadpool_interface)
TARGET_INCLUDE_DIRECTORIES(pthreadpool PRIVATE src)
IF(NOT CMAKE_SYSTEM_NAME STREQUAL "Emscripten")