summaryrefslogtreecommitdiffstats
path: root/src/seastar/cmake/FindPthreadSetName.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'src/seastar/cmake/FindPthreadSetName.cmake')
-rw-r--r--src/seastar/cmake/FindPthreadSetName.cmake12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/seastar/cmake/FindPthreadSetName.cmake b/src/seastar/cmake/FindPthreadSetName.cmake
new file mode 100644
index 00000000..547b9f5a
--- /dev/null
+++ b/src/seastar/cmake/FindPthreadSetName.cmake
@@ -0,0 +1,12 @@
+include (CMakePushCheckState)
+
+cmake_push_check_state (RESET)
+set (CMAKE_REQUIRED_FLAGS "-pthread")
+set (CMAKE_REQUIRED_DEFINITIONS "-D_GNU_SOURCE")
+check_symbol_exists (pthread_setname_np pthread.h HAVE_PTHREAD_SETNAME_NP)
+cmake_pop_check_state ()
+
+find_package_handle_standard_args (PthreadSetName
+ FOUND_VAR PthreadSetName_FOUND
+ REQUIRED_VARS
+ HAVE_PTHREAD_SETNAME_NP)