From fcfb0c9442550ed5acf34a3b56d602408f25159b Mon Sep 17 00:00:00 2001 From: Igor Fedotov Date: Tue, 12 Nov 2019 01:20:12 +0300 Subject: [PATCH] cmake: detect gettid() presense Signed-off-by: Igor Fedotov --- cmake/modules/CephChecks.cmake | 1 + src/test/fio/CMakeLists.txt | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/cmake/modules/CephChecks.cmake b/cmake/modules/CephChecks.cmake index f5a77abc6e6..0f3f9a1d48a 100644 --- a/cmake/modules/CephChecks.cmake +++ b/cmake/modules/CephChecks.cmake @@ -38,6 +38,7 @@ cmake_pop_check_state() check_function_exists(eventfd HAVE_EVENTFD) check_function_exists(getprogname HAVE_GETPROGNAME) +check_function_exists(gettid HAVE_GETTID) CHECK_INCLUDE_FILES("linux/types.h" HAVE_LINUX_TYPES_H) CHECK_INCLUDE_FILES("linux/version.h" HAVE_LINUX_VERSION_H) diff --git a/src/test/fio/CMakeLists.txt b/src/test/fio/CMakeLists.txt index 4bfbaefe04d..c55ef37bbb0 100644 --- a/src/test/fio/CMakeLists.txt +++ b/src/test/fio/CMakeLists.txt @@ -6,8 +6,12 @@ target_include_directories(fio_ceph_objectstore SYSTEM PUBLIC ${FIO_INCLUDE_DIR} add_library(fio_ceph_messenger SHARED fio_ceph_messenger.cc) target_include_directories(fio_ceph_messenger SYSTEM PUBLIC ${FIO_INCLUDE_DIR}) -# prevent fio from adding a 'typedef int bool' -set(FIO_CFLAGS "-DCONFIG_HAVE_BOOL") +# prevent fio from adding 'typedef int bool' and gettid() +if(HAVE_GETTID) + set(FIO_CFLAGS "-DCONFIG_HAVE_BOOL -DCONFIG_HAVE_GETTID") +else() + set(FIO_CFLAGS "-DCONFIG_HAVE_BOOL") +endif() # fio headers use typeof(), which requires c++11 extensions set_target_properties(fio_ceph_objectstore PROPERTIES -- 2.39.5