]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: detect gettid() presense 40333/head
authorIgor Fedotov <ifedotov@suse.com>
Mon, 11 Nov 2019 22:20:12 +0000 (01:20 +0300)
committerKefu Chai <kchai@redhat.com>
Tue, 23 Mar 2021 07:25:41 +0000 (15:25 +0800)
Signed-off-by: Igor Fedotov <ifedotov@suse.com>
(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.

CMakeLists.txt
src/test/fio/CMakeLists.txt

index 8d504c0b09864e2318454723004764a7836dd8bd..cf38537eb456546ebc98b457a8a557a993d0ae8b 100644 (file)
@@ -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)
index 81783d45aabbefddaed01a0562f8530701df0092..e75a3cc495a7560c73bce38006b5db00374ef6b0 100644 (file)
@@ -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