Skip to content

Commit

Permalink
cmake: move ContextCompletion.cc into rbd_internal
Browse files Browse the repository at this point in the history
- ContextCompletion.cc is used by TrimRequest.cc which is included by
  rbd_internal, it's more natural to put ContextCompletion.cc into
  rbd_internal also. as rbd_internal is the only consumer of this
  translation unit.
- librbd/internal.cc is not referencing any symbols from util.cc, so
  remove this include. and also, do not add
  $<TARGET_OBJECTS:common_util_obj> to librbd.

Signed-off-by: Kefu Chai <kchai@redhat.com>
  • Loading branch information
tchaikov committed Nov 9, 2016
1 parent 956f367 commit 3194e3f
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 11 deletions.
6 changes: 2 additions & 4 deletions src/librbd/CMakeLists.txt
Expand Up @@ -82,7 +82,8 @@ set(librbd_internal_srcs
operation/SnapshotRollbackRequest.cc
operation/SnapshotUnprotectRequest.cc
operation/SnapshotLimitRequest.cc
operation/TrimRequest.cc)
operation/TrimRequest.cc
${CMAKE_SOURCE_DIR}/src/common/ContextCompletion.cc)

add_library(rbd_api STATIC librbd.cc)
add_library(rbd_internal STATIC
Expand All @@ -93,9 +94,6 @@ if(WITH_LTTNG)
endif()

add_library(librbd ${CEPH_SHARED}
$<TARGET_OBJECTS:osdc_rbd_objs>
$<TARGET_OBJECTS:common_util_obj>
${CMAKE_SOURCE_DIR}/src/common/ContextCompletion.cc
librbd.cc)
if(LINUX)
list(APPEND librbd
Expand Down
1 change: 0 additions & 1 deletion src/librbd/internal.cc
Expand Up @@ -43,7 +43,6 @@
#include "librbd/exclusive_lock/AutomaticPolicy.h"
#include "librbd/exclusive_lock/StandardPolicy.h"
#include "librbd/operation/TrimRequest.h"
#include "include/util.h"

#include "journal/Journaler.h"

Expand Down
2 changes: 0 additions & 2 deletions src/test/librbd/CMakeLists.txt
Expand Up @@ -60,7 +60,6 @@ set(unittest_librbd_srcs
)
add_executable(unittest_librbd
${unittest_librbd_srcs}
${CMAKE_SOURCE_DIR}/src/common/ContextCompletion.cc
$<TARGET_OBJECTS:common_texttable_obj>)
target_compile_definitions(unittest_librbd PUBLIC "-DTEST_LIBRBD_INTERNALS")
set_target_properties(unittest_librbd PROPERTIES COMPILE_FLAGS
Expand Down Expand Up @@ -88,7 +87,6 @@ target_link_libraries(unittest_librbd

add_executable(ceph_test_librbd
test_main.cc
${CMAKE_SOURCE_DIR}/src/common/ContextCompletion.cc
$<TARGET_OBJECTS:common_texttable_obj>)
target_link_libraries(ceph_test_librbd
rbd_test
Expand Down
2 changes: 0 additions & 2 deletions src/test/rbd_mirror/CMakeLists.txt
Expand Up @@ -25,7 +25,6 @@ add_executable(unittest_rbd_mirror
image_sync/test_mock_SnapshotCreateRequest.cc
image_sync/test_mock_SyncPointCreateRequest.cc
image_sync/test_mock_SyncPointPruneRequest.cc
${CMAKE_SOURCE_DIR}/src/common/ContextCompletion.cc
)
add_ceph_unittest(unittest_rbd_mirror ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_rbd_mirror)
set_target_properties(unittest_rbd_mirror PROPERTIES COMPILE_FLAGS
Expand Down Expand Up @@ -55,7 +54,6 @@ target_link_libraries(unittest_rbd_mirror

add_executable(ceph_test_rbd_mirror
test_main.cc
${CMAKE_SOURCE_DIR}/src/common/ContextCompletion.cc
)
set_target_properties(ceph_test_rbd_mirror PROPERTIES COMPILE_FLAGS
${UNITTEST_CXX_FLAGS})
Expand Down
3 changes: 1 addition & 2 deletions src/tools/rbd_mirror/CMakeLists.txt
Expand Up @@ -26,8 +26,7 @@ add_library(rbd_mirror_internal STATIC
${rbd_mirror_internal})

add_executable(rbd-mirror
main.cc
${CMAKE_SOURCE_DIR}/src/common/ContextCompletion.cc)
main.cc)
target_link_libraries(rbd-mirror
rbd_mirror_internal
rbd_api
Expand Down

0 comments on commit 3194e3f

Please sign in to comment.