diff --git a/contrib/arrow-cmake/CMakeLists.txt b/contrib/arrow-cmake/CMakeLists.txt index 4733021b865..231185462dc 100644 --- a/contrib/arrow-cmake/CMakeLists.txt +++ b/contrib/arrow-cmake/CMakeLists.txt @@ -445,7 +445,10 @@ set (HAVE_GETHOSTBYNAME 1) set (HAVE_STRERROR_R 1) set (HAVE_SCHED_GET_PRIORITY_MAX 1) set (HAVE_SCHED_GET_PRIORITY_MIN 1) -set (STRERROR_R_CHAR_P 1) + +if (OS_LINUX) + set (STRERROR_R_CHAR_P 1) +endif () #set(PACKAGE ${PACKAGE_NAME}) #set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") diff --git a/contrib/cassandra-cmake/CMakeLists.txt b/contrib/cassandra-cmake/CMakeLists.txt index 1215b5e05a6..db7f1096000 100644 --- a/contrib/cassandra-cmake/CMakeLists.txt +++ b/contrib/cassandra-cmake/CMakeLists.txt @@ -15,7 +15,6 @@ set(CASS_USE_LIBSSH2 0) set(CASS_USE_OPENSSL 1) set(CASS_USE_STD_ATOMIC 1) set(CASS_USE_ZLIB 1) -set(CASS_USE_TIMERFD 0) file(GLOB SOURCES ${CASS_SRC_DIR}/*.cpp) @@ -80,20 +79,17 @@ configure_file("${CASS_SRC_DIR}/third_party/sparsehash/config.h.cmake" "${CMAKE_ # Determine random availability -if(CMAKE_SYSTEM_NAME MATCHES "Linux") - check_symbol_exists(GRND_NONBLOCK "linux/random.h" HAVE_GETRANDOM) - if(CASS_USE_TIMERFD) - check_symbol_exists(timerfd_create "sys/timerfd.h" HAVE_TIMERFD) - endif() -else() - check_symbol_exists(arc4random_buf "stdlib.h" HAVE_ARC4RANDOM) -endif() +if (OS_LINUX) + set (HAVE_GETRANDOM 1) +elseif (OS_FREEBSD OR OS_DARWIN) + set (HAVE_ARC4RANDOM 1) +endif () # Determine if sigpipe is available -check_symbol_exists(SO_NOSIGPIPE "sys/socket.h;sys/types.h" HAVE_NOSIGPIPE) -check_symbol_exists(sigtimedwait "signal.h" HAVE_SIGTIMEDWAIT) -if (NOT WIN32 AND NOT HAVE_NOSIGPIPE AND NOT HAVE_SIGTIMEDWAIT) - message(WARNING "Unable to handle SIGPIPE on your platform") +if (OS_LINUX) + set (HAVE_SIGTIMEDWAIT 1) +else (OS_FREEBSD OR OS_DARWIN) + set (HAVE_NOSIGPIPE 1) endif() set (HAVE_BUILTIN_BSWAP32 1) @@ -121,7 +117,7 @@ add_library(cassandra target_link_libraries(cassandra zlib) add_library(cassandra_static ALIAS cassandra) -target_include_directories(cassandra PRIVATE ${INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR}) +target_include_directories(cassandra PRIVATE ${CMAKE_CURRENT_BINARY_DIR} ${INCLUDE_DIRS}) target_compile_definitions(cassandra PRIVATE CASS_BUILDING) target_link_libraries(cassandra uv) diff --git a/contrib/xz-cmake/CMakeLists.txt b/contrib/xz-cmake/CMakeLists.txt index ae21d843d74..af8ebb0ebc1 100644 --- a/contrib/xz-cmake/CMakeLists.txt +++ b/contrib/xz-cmake/CMakeLists.txt @@ -69,9 +69,6 @@ add_compile_definitions( _TANDEM_SOURCE _ALL_SOURCE - TUKLIB_CPUCORES_SCHED_GETAFFINITY - TUKLIB_PHYSMEM_SYSCONF - HAVE_CLOCK_GETTIME=1 HAVE_DECL_CLOCK_MONOTONIC=1 @@ -79,6 +76,20 @@ add_compile_definitions( MYTHREAD_POSIX ) +if (OS_LINUX) + add_compile_definitions( + TUKLIB_CPUCORES_SCHED_GETAFFINITY + TUKLIB_PHYSMEM_SYSCONF) +elseif (OS_FREEBSD) + add_compile_definitions( + TUKLIB_CPUCORES_CPUSET + TUKLIB_PHYSMEM_SYSCTL) +elseif (OS_DARWIN) + add_compile_definitions( + TUKLIB_CPUCORES_SYSCTL + TUKLIB_PHYSMEM_SYSCTL) +endif () + if (ARCH_AMD64 OR ARCH_AARCH64) add_compile_definitions(TUKLIB_FAST_UNALIGNED_ACCESS=1) endif ()