summaryrefslogtreecommitdiffstats
path: root/cmake/FindStdatomic.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/FindStdatomic.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!")