]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
cmake: link against libfuse if HAVE_LIBFUSE
authorKefu Chai <kchai@redhat.com>
Thu, 28 Jan 2016 06:47:07 +0000 (14:47 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 28 Jan 2016 15:36:45 +0000 (23:36 +0800)
* use ${FUSE_LIBRARIES} instead of "fuse" when referencing libfuse.
* do not compile FuseStore.cc if !HAVE_LIBFUSE.
* CMakeLists.txt: s/HAVE_FUSE/HAVE_LIBFUSE/, to match with the one
  defined for config.h.in.cmake, otherwise we need two vars:
  HAVE_LIBFUSE, and HAVE_FUSE

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

index 703e43dfeec50d38416af3e2b438620a7278c50f..b17e864c2958873ddaa09ae91936b90b8e46c165 100644 (file)
@@ -126,7 +126,7 @@ endif(${WITH_AIO})
 option(WITH_FUSE "Fuse is here" ON)
 if(${WITH_FUSE})
 find_package(fuse)
-set(HAVE_FUSE ${FUSE_FOUND})
+set(HAVE_LIBFUSE ${FUSE_FOUND})
 CHECK_FUNCTION_EXISTS(fuse_getgroups HAVE_FUSE_GETGROUPS)
 endif(${WITH_FUSE})
 
index f6a7807dbe544b6615d50f3c8868611574399eb7..7c9c9755c4fd02f8bd0c59756a906d10458b4188 100644 (file)
@@ -626,7 +626,6 @@ if(${HAVE_XFS})
     os/fs/XFS.cc)
 endif(${HAVE_XFS})
 set(libos_srcs
-  os/FuseStore.cc
   os/ObjectStore.cc
   os/Transaction.cc
   os/filestore/chain_xattr.cc
@@ -656,6 +655,10 @@ set(libos_srcs
   os/bluestore/StupidAllocator.cc
   os/fs/FS.cc
   ${libos_xfs_srcs})
+if(${HAVE_LIBFUSE})
+  list(APPEND libos_srcs
+    os/FuseStore.cc)
+endif(${HAVE_LIBFUSE})
 
 # make rocksdb statically
 add_custom_target(build_rocksdb
@@ -679,6 +682,9 @@ endif(${HAVE_LIBAIO})
 if(${WITH_LTTNG})
   target_link_libraries(os libos_tp)
 endif(${WITH_LTTNG})
+if(${HAVE_LIBFUSE})
+  target_link_libraries(os ${FUSE_LIBRARIES})
+endif(${HAVE_LIBFUSE})
 target_link_libraries(os kv)
 
 set(cls_references_files objclass/class_api.cc)
@@ -728,7 +734,10 @@ add_executable(ceph-osd ${ceph_osd_srcs}
   $<TARGET_OBJECTS:heap_profiler_objs>
   $<TARGET_OBJECTS:common_util_obj>)
 add_dependencies(ceph-osd erasure_code_plugins)
-target_link_libraries(ceph-osd osd os global ${BLKID_LIBRARIES} ${ALLOC_LIBS} fuse)
+target_link_libraries(ceph-osd osd os global ${BLKID_LIBRARIES} ${ALLOC_LIBS})
+if(${HAVE_LIBFUSE})
+  target_link_libraries(ceph-osd ${FUSE_LIBRARIES})
+endif(${HAVE_LIBFUSE})
 install(TARGETS ceph-osd DESTINATION bin)
 
 # MDS
@@ -928,15 +937,15 @@ endif(${ENABLE_SHARED})
   install(TARGETS ceph-syn DESTINATION bin)
   install(TARGETS mount.ceph DESTINATION sbin)
 
-  if(HAVE_FUSE)
+  if(HAVE_LIBFUSE)
     set(ceph_fuse_srcs
       ceph_fuse.cc
       client/fuse_ll.cc)
     add_executable(ceph-fuse ${ceph_fuse_srcs})
-    target_link_libraries(ceph-fuse fuse client global)
+    target_link_libraries(ceph-fuse ${FUSE_LIBRARIES} client global)
     set_target_properties(ceph-fuse PROPERTIES COMPILE_FLAGS "-I${FUSE_INCLUDE_DIRS}")
     install(TARGETS ceph-fuse DESTINATION bin)
-  endif(HAVE_FUSE)
+  endif(HAVE_LIBFUSE)
 endif(WITH_LIBCEPHFS)
 
 set(journal_srcs
index 974a96b411d19f02bcaf2c67340bd2bf6c606efa..98d8b9146d9c1fe859c18c1d1af7dca42ad02091 100644 (file)
@@ -2335,7 +2335,7 @@ target_link_libraries(test_keyvaluedb_iterators
   ${CMAKE_DL_LIBS}
   )
 
-if(${HAVE_FUSE})
+if(${HAVE_LIBFUSE})
   add_executable(test_cfuse_cache_invalidate
     test_cfuse_cache_invalidate.cc
     )
@@ -2346,7 +2346,7 @@ if(${HAVE_FUSE})
     ${ALLOC_LIBS}
     ${CMAKE_DL_LIBS}
     )
-endif(${HAVE_FUSE})
+endif(${HAVE_LIBFUSE})
 
 if(${WITH_CEPHFS})
   add_executable(test_c_headers