summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorManuel Bentele2021-06-16 11:33:31 +0200
committerManuel Bentele2021-06-16 11:41:16 +0200
commita04431a3125de160ca082b27ee31fa1e1037cea9 (patch)
tree4abb8f32d467f85702866ff5d5f457b7e5009a37 /cmake
parent[KERNEL] Add support for Linux kernels without blk-mq (e.g. CentOS 7) (diff)
downloaddnbd3-a04431a3125de160ca082b27ee31fa1e1037cea9.tar.gz
dnbd3-a04431a3125de160ca082b27ee31fa1e1037cea9.tar.xz
dnbd3-a04431a3125de160ca082b27ee31fa1e1037cea9.zip
[BUILD] Add check for stdatomic.h support
Diffstat (limited to 'cmake')
-rw-r--r--cmake/FindStdatomic.cmake14
1 files changed, 14 insertions, 0 deletions
diff --git a/cmake/FindStdatomic.cmake b/cmake/FindStdatomic.cmake
new file mode 100644
index 0000000..d7ee9b8
--- /dev/null
+++ b/cmake/FindStdatomic.cmake
@@ -0,0 +1,14 @@
+# SPDX-License-Identifier: GPL-2.0
+#
+# Copyright (C) 2021 Manuel Bentele <development@manuel-bentele.de>
+#
+
+find_file(Stdatomic_INCLUDE_FILE
+ NAMES stdatomic.h
+ HINTS ${CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES})
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(Stdatomic
+ FOUND_VAR Stdatomic_FOUND
+ REQUIRED_VARS Stdatomic_INCLUDE_FILE
+ FAIL_MESSAGE "Compiler does not support atomic operations!")