From: Igor Fedotov Date: Mon, 11 Nov 2019 22:20:12 +0000 (+0300) Subject: cmake: detect gettid() presense X-Git-Tag: v14.2.22~22^2~5^2~8^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F40333%2Fhead;p=ceph.git cmake: detect gettid() presense Signed-off-by: Igor Fedotov (cherry picked from commit fcfb0c9442550ed5acf34a3b56d602408f25159b) Conflicts: cmake/modules/CephChecks.cmake src/test/fio/CMakeLists.txt: check gettid() in /CMakeLists.txt instead, as nautilus does not have cmake/modules/CephChecks.cmake by then. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 8d504c0b09864..cf38537eb4565 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -123,6 +123,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 81783d45aabbe..e75a3cc495a75 100644 --- a/src/test/fio/CMakeLists.txt +++ b/src/test/fio/CMakeLists.txt @@ -1,8 +1,12 @@ add_library(fio_ceph_objectstore SHARED fio_ceph_objectstore.cc) target_include_directories(fio_ceph_objectstore 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