mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-09-30 03:34:25 +03:00
test for pthread_setaffinity_np
Only enable setting threads per core when available
This commit is contained in:
@@ -11,6 +11,18 @@ else()
|
||||
set(EXTRA_CXX_FLAGS "${EXTRA_CXX_FLAGS} -isystem ${SQLITE3_INCLUDE_DIRS}")
|
||||
endif()
|
||||
|
||||
# BSD has the _np funcs in a _np header
|
||||
CHECK_INCLUDE_FILE(pthread_np.h HAVE_PTHREAD_NP_H)
|
||||
if (HAVE_PTHREAD_NP_H)
|
||||
set (PTHREAD_NP_INC pthread_np.h)
|
||||
else ()
|
||||
set (PTHREAD_NP_INC pthread.h)
|
||||
endif ()
|
||||
|
||||
set (CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -D_GNU_SOURCE")
|
||||
set (CMAKE_REQUIRED_LIBRARIES pthread)
|
||||
CHECK_CXX_SYMBOL_EXISTS(pthread_setaffinity_np ${PTHREAD_NP_INC} HAVE_DECL_PTHREAD_SETAFFINITY_NP)
|
||||
|
||||
CHECK_FUNCTION_EXISTS(malloc_info HAVE_MALLOC_INFO)
|
||||
CHECK_FUNCTION_EXISTS(shmget HAVE_SHMGET)
|
||||
set(HAVE_SHMGET ${HAVE_SHMGET} CACHE BOOL "shmget()")
|
||||
|
Reference in New Issue
Block a user