]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: extract ceph-dencoder related stuff out 23166/head
authorKefu Chai <kchai@redhat.com>
Sun, 22 Jul 2018 02:01:11 +0000 (10:01 +0800)
committerKefu Chai <kchai@redhat.com>
Sun, 22 Jul 2018 02:01:14 +0000 (10:01 +0800)
let's modularize the cmake file piecemeal.

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

index a0988cf9c662304f145e0354a7fb018a3420abf7..c0d7590a548908f21f3148f2752db6ce9baf37e0 100644 (file)
@@ -667,7 +667,6 @@ endif()
 
 set_source_files_properties(${CMAKE_SOURCE_DIR}/src/ceph_ver.c
   ${CMAKE_SOURCE_DIR}/src/common/version.cc
-  ${CMAKE_SOURCE_DIR}/src/test/encoding/ceph_dencoder.cc
   APPEND PROPERTY OBJECT_DEPENDS ${CMAKE_BINARY_DIR}/src/include/ceph_ver.h)
 
 if(HAVE_ARMV8_CRC)
@@ -790,61 +789,6 @@ endif()
 add_subdirectory(pybind)
 add_subdirectory(ceph-volume)
 
-## dencoder
-if(HAS_VTA)
-  set_source_files_properties(test/encoding/ceph_dencoder.cc
-    PROPERTIES COMPILE_FLAGS -fno-var-tracking-assignments)
-endif()
-
-set(dencoder_srcs
-  test/encoding/ceph_dencoder.cc
-  $<TARGET_OBJECTS:common_texttable_obj>
-  )
-if(${WITH_RADOSGW})
-  list(APPEND dencoder_srcs
-    rgw/rgw_dencoder.cc
-  )
-  set(DENCODER_EXTRALIBS
-    rgw_a
-    cls_rgw_client
-  )
-endif(${WITH_RADOSGW})
-if(WITH_RBD)
-  set(DENCODER_EXTRALIBS
-    ${DENCODER_EXTRALIBS}
-    cls_rbd_client
-    rbd_mirror_types
-    rbd_types
-    rbd_replay_types)
-  if(WITH_KRBD)
-    set(DENCODER_EXTRALIBS
-      ${DENCODER_EXTRALIBS}
-      krbd)
-  endif()
-endif(WITH_RBD)
-
-add_executable(ceph-dencoder ${dencoder_srcs})
-target_link_libraries(ceph-dencoder
-  global
-  os
-  osd
-  mds
-  mon
-  journal
-  ${DENCODER_EXTRALIBS}
-  cls_lock_client
-  cls_refcount_client
-  cls_log_client
-  cls_statelog_client
-  cls_version_client
-  cls_user_client
-  cls_journal_client
-  cls_timeindex_client
-  ${EXTRALIBS}
-  ${CMAKE_DL_LIBS}
-  )
-install(TARGETS ceph-dencoder DESTINATION bin)
-
 # Monitor
 add_subdirectory(mon)
 set(ceph_mon_srcs
index 0ee20fe1f91fa8543b000f915fc18b382038fce5..1e0dd7cca8c25beadc0bd83fcb3b815a553f2df1 100644 (file)
@@ -2,3 +2,60 @@
 add_ceph_test(check-generated.sh ${CMAKE_CURRENT_SOURCE_DIR}/check-generated.sh)
 add_ceph_test(readable.sh ${CMAKE_CURRENT_SOURCE_DIR}/readable.sh)
 
+## dencoder
+set_source_files_properties(
+  ${CMAKE_SOURCE_DIR}/src/test/encoding/ceph_dencoder.cc
+  APPEND PROPERTY OBJECT_DEPENDS ${CMAKE_BINARY_DIR}/src/include/ceph_ver.h)
+
+if(HAS_VTA)
+  set_source_files_properties(test/encoding/ceph_dencoder.cc
+    PROPERTIES COMPILE_FLAGS -fno-var-tracking-assignments)
+endif()
+
+set(dencoder_srcs
+  ceph_dencoder.cc
+  $<TARGET_OBJECTS:common_texttable_obj>)
+if(WITH_RADOSGW)
+  list(APPEND dencoder_srcs
+    ${CMAKE_SOURCE_DIR}/src/rgw/rgw_dencoder.cc)
+endif()
+
+add_executable(ceph-dencoder ${dencoder_srcs})
+
+if(WITH_RADOSGW)
+  list(APPEND DENCODER_EXTRALIBS
+    rgw_a
+    cls_rgw_client)
+endif()
+
+if(WITH_RBD)
+  list(APPEND DENCODER_EXTRALIBS
+    cls_rbd_client
+    rbd_mirror_types
+    rbd_types
+    rbd_replay_types)
+  if(WITH_KRBD)
+    list(APPEND DENCODER_EXTRALIBS
+      krbd)
+  endif()
+endif()
+
+target_link_libraries(ceph-dencoder
+  global
+  os
+  osd
+  mds
+  mon
+  journal
+  ${DENCODER_EXTRALIBS}
+  cls_lock_client
+  cls_refcount_client
+  cls_log_client
+  cls_statelog_client
+  cls_version_client
+  cls_user_client
+  cls_journal_client
+  cls_timeindex_client
+  ${EXTRALIBS}
+  ${CMAKE_DL_LIBS})
+install(TARGETS ceph-dencoder DESTINATION bin)