]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: expose FIO_INCLUDE_DIR via libfio 37984/head
authorKefu Chai <kchai@redhat.com>
Mon, 9 Nov 2020 07:47:41 +0000 (15:47 +0800)
committerKefu Chai <kchai@redhat.com>
Mon, 9 Nov 2020 08:01:59 +0000 (16:01 +0800)
always use the fio built from source for better consistency.

Signed-off-by: Kefu Chai <kchai@redhat.com>
CMakeLists.txt
cmake/modules/BuildFIO.cmake
src/test/fio/CMakeLists.txt

index 9ae3dac66c612c2dc9d4fcca0f67d954b7f69973..e2da7739c26fa2c308f46cd5874967c0c94daed1 100644 (file)
@@ -507,10 +507,6 @@ set(CEPH_TEST_TIMEOUT 3600 CACHE STRING
 # fio
 option(WITH_FIO "build with fio plugin enabled" OFF)
 if(WITH_FIO)
-  if (NOT FIO_INCLUDE_DIR)
-    # Use local external fio if include directory is not set
-    set(FIO_INCLUDE_DIR ${CMAKE_BINARY_DIR}/src/fio)
-  endif()
   include(BuildFIO)
   build_fio()
 endif()
index f0a9c0e332756cf571c9d64d2d0bed3122d121b3..d3288cc330919a82f42802cb608a811925257d9c 100644 (file)
@@ -21,4 +21,9 @@ function(build_fio)
     CONFIGURE_COMMAND <SOURCE_DIR>/configure
     BUILD_COMMAND ${make_cmd} fio EXTFLAGS=-Wno-format-truncation ${FIO_EXTLIBS}
     INSTALL_COMMAND cp <BINARY_DIR>/fio ${CMAKE_BINARY_DIR}/bin)
+
+  add_library(fio INTERFACE IMPORTED)
+  add_dependencies(fio fio_ext)
+  set_target_properties(fio PROPERTIES
+    INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_BINARY_DIR}/src/fio)
 endfunction()
index c55ef37bbb0e534b46199485b6a4f86a696254c2..ceda247df710e73e48c0b1a4a3ce61d5b9ce456a 100644 (file)
@@ -1,10 +1,10 @@
 # ObjectStore
 add_library(fio_ceph_objectstore SHARED fio_ceph_objectstore.cc)
-target_include_directories(fio_ceph_objectstore SYSTEM PUBLIC ${FIO_INCLUDE_DIR})
+target_link_libraries(fio_ceph_objectstore fio)
 
 # Messenger
 add_library(fio_ceph_messenger SHARED fio_ceph_messenger.cc)
-target_include_directories(fio_ceph_messenger SYSTEM PUBLIC ${FIO_INCLUDE_DIR})
+target_link_libraries(fio_ceph_messenger fio)
 
 # prevent fio from adding 'typedef int bool' and gettid()
 if(HAVE_GETTID)