]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
CMakeLists.txt: Introduce WITH_KBRD for kernel RBD
authorWillem Jan Withagen <wjw@digiware.nl>
Thu, 5 Jan 2017 10:59:42 +0000 (11:59 +0100)
committerWillem Jan Withagen <wjw@digiware.nl>
Thu, 12 Jan 2017 15:12:41 +0000 (16:12 +0100)
Signed-off-by: Willem Jan Withagen <wjw@digiware.nl>
CMakeLists.txt
src/CMakeLists.txt
src/librbd/CMakeLists.txt
src/tools/CMakeLists.txt
src/tools/rbd/CMakeLists.txt

index 898e4abdbc5f9befa325c0cf9081889d6922abd2..b202893a79ec05834c9cac6027ba374d4c91b89b 100644 (file)
@@ -232,6 +232,13 @@ option(WITH_KVS "Key value store is here" ON)
 # remote block storage
 option(WITH_RBD "Remote block storage is here" ON)
 
+# KERNEL remote block storage
+option(WITH_KRBD "Kernel Remote block storage is here" ON)
+
+if(WITH_KRBD AND WITHOUT_RBD)
+  message(FATAL_ERROR "Cannot have WITH_KRBD with WITH_RBD.")
+endif()
+
 # embedded ceph daemon static library
 # NOTE: Ceph is mostly LGPL (see COPYING), which means that
 # static linking brings with it restrictions. Please be sure
@@ -288,7 +295,7 @@ if(NOT JEMALLOC_FOUND)
   CHECK_FUNCTION_EXISTS(mallinfo HAVE_MALLINFO)
 endif()
 
-if(WITH_LIBCEPHFS OR WITH_RBD)
+if(WITH_LIBCEPHFS OR WITH_KRBD)
   find_package(keyutils REQUIRED)
 endif()
 
index 409981e575d1756f9bcc07fbd2b850cb5142480b..02f617780c6c34092f64d562ae3e417439e65c92 100644 (file)
@@ -664,9 +664,13 @@ if(WITH_RBD)
   set(DENCODER_EXTRALIBS
     ${DENCODER_EXTRALIBS}
     cls_rbd_client
-    krbd
     rbd_types
     rbd_replay_types)
+  if(WITH_KRBD)
+    set(DENCODER_EXTRALIBS
+      ${DENCODER_EXTRALIBS}
+      krbd)
+  endif()
 endif(WITH_RBD)
 
 add_executable(ceph-dencoder ${dencoder_srcs})
@@ -850,7 +854,7 @@ install(PROGRAMS
 
 add_subdirectory(bash_completion)
 
-if(WITH_LIBCEPHFS OR WITH_RBD)
+if(WITH_LIBCEPHFS OR WITH_KRBD)
   set(parse_secret_files
     common/secret.c)
   add_library(parse_secret_objs OBJECT ${parse_secret_files})
@@ -906,10 +910,12 @@ endif(WITH_LIBCEPHFS)
 
 add_subdirectory(journal)
 
-if(${WITH_RBD})
-  add_library(krbd STATIC krbd.cc
-    $<TARGET_OBJECTS:parse_secret_objs>)
-  target_link_libraries(krbd ${KEYUTILS_LIBRARIES} ${UDEV_LIBRARIES})
+if(WITH_RBD)
+  if(WITH_KRBD)
+    add_library(krbd STATIC krbd.cc
+      $<TARGET_OBJECTS:parse_secret_objs>)
+    target_link_libraries(krbd ${KEYUTILS_LIBRARIES} ${UDEV_LIBRARIES})
+  endif()
   add_subdirectory(librbd)
   if(WITH_FUSE)
     add_subdirectory(rbd_fuse)
@@ -921,7 +927,7 @@ if(${WITH_RBD})
     ${CMAKE_SOURCE_DIR}/src/rbdmap
     DESTINATION ${CMAKE_INSTALL_BINDIR})
   add_subdirectory(rbd_replay)
-endif(${WITH_RBD})
+endif(WITH_RBD)
 
 # RadosGW
 if(WITH_KVS)
index 4c9b2731cf8a4efa60f8c598254fe55ff0487338..0b224ce15dff9a37399c2e9c3f4d9581f4d21269 100644 (file)
@@ -116,6 +116,10 @@ target_link_libraries(librbd LINK_PRIVATE
   pthread
   ${CMAKE_DL_LIBS}
   ${EXTRALIBS})
+if(HAVE_UDEV)
+  target_link_libraries(librbd LINK_PRIVATE
+    udev)
+endif()
 if(ENABLE_SHARED)
   set_target_properties(librbd PROPERTIES
     OUTPUT_NAME rbd
index 0d53ca6cd645e0fdc9b6cd1d0c1bd76488f0a0c3..f6336fa594f2f8e2f24b34494e1d4bc6dbe83407 100644 (file)
@@ -97,5 +97,7 @@ endif(WITH_CEPHFS)
 if(WITH_RBD)
   add_subdirectory(rbd)
   add_subdirectory(rbd_mirror)
-  add_subdirectory(rbd_nbd)
+  if(LINUX)
+    add_subdirectory(rbd_nbd)
+  endif()
 endif(WITH_RBD)
index 7b1c9dc70680102068712c67c97ef0da1fef0cd8..fea7b7b50868b8f25f2518c5d1c3729ceab99d02 100644 (file)
@@ -42,10 +42,14 @@ add_executable(rbd ${rbd_srcs}
 set_target_properties(rbd PROPERTIES OUTPUT_NAME rbd)
 target_link_libraries(rbd librbd librados
   cls_journal_client cls_rbd_client
-  krbd
   rbd_types
   journal
   ceph-common global
   ${Boost_REGEX_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY}
   ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS})
+if(WITH_KRBD)
+  target_link_libraries(rbd 
+    krbd)
+endif()
+
 install(TARGETS rbd DESTINATION bin)