Skip to content

Commit

Permalink
Checks for pthread setname and setaffinity API are compilation checks…
Browse files Browse the repository at this point in the history
…, not execution checks.
  • Loading branch information
guill-delacourt authored and bluca committed Jun 11, 2023
1 parent 797c7f0 commit e0296d9
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 17 deletions.
28 changes: 16 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -730,20 +730,24 @@ if(NOT ANDROID)
endif()

# -----------------------------------------------------------------------------
if(NOT CMAKE_CROSSCOMPILING AND NOT MSVC)
zmq_check_sock_cloexec()
zmq_check_o_cloexec()
zmq_check_so_bindtodevice()
zmq_check_so_keepalive()
zmq_check_so_priority()
zmq_check_tcp_keepcnt()
zmq_check_tcp_keepidle()
zmq_check_tcp_keepintvl()
zmq_check_tcp_keepalive()
zmq_check_tcp_tipc()
if (NOT MSVC)
# Compilation checks
zmq_check_pthread_setname()
zmq_check_pthread_setaffinity()
zmq_check_getrandom()
# Execution checks
if(NOT CMAKE_CROSSCOMPILING)
zmq_check_sock_cloexec()
zmq_check_o_cloexec()
zmq_check_so_bindtodevice()
zmq_check_so_keepalive()
zmq_check_so_priority()
zmq_check_tcp_keepcnt()
zmq_check_tcp_keepidle()
zmq_check_tcp_keepintvl()
zmq_check_tcp_keepalive()
zmq_check_tcp_tipc()
zmq_check_getrandom()
endif()
endif()

if(CMAKE_SYSTEM_NAME MATCHES "Linux"
Expand Down
10 changes: 5 additions & 5 deletions builds/cmake/Modules/ZMQSourceRunChecks.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ macro(zmq_check_pthread_setname)
message(STATUS "Checking pthread_setname signature")
set(SAVE_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
set(CMAKE_REQUIRED_FLAGS "-D_GNU_SOURCE -Werror -pthread")
check_c_source_runs(
check_c_source_compiles(
"
#include <pthread.h>
Expand All @@ -223,7 +223,7 @@ int main(int argc, char *argv [])
}
"
ZMQ_HAVE_PTHREAD_SETNAME_1)
check_c_source_runs(
check_c_source_compiles(
"
#include <pthread.h>
Expand All @@ -234,7 +234,7 @@ int main(int argc, char *argv [])
}
"
ZMQ_HAVE_PTHREAD_SETNAME_2)
check_c_source_runs(
check_c_source_compiles(
"
#include <pthread.h>
Expand All @@ -245,7 +245,7 @@ int main(int argc, char *argv [])
}
"
ZMQ_HAVE_PTHREAD_SETNAME_3)
check_c_source_runs(
check_c_source_compiles(
"
#include <pthread.h>
Expand All @@ -263,7 +263,7 @@ macro(zmq_check_pthread_setaffinity)
message(STATUS "Checking pthread_setaffinity signature")
set(SAVE_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
set(CMAKE_REQUIRED_FLAGS "-D_GNU_SOURCE -Werror -pthread")
check_c_source_runs(
check_c_source_compiles(
"
#include <pthread.h>
Expand Down

0 comments on commit e0296d9

Please sign in to comment.