]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: restrict crush_objs in libcrimson-alienstore.a.
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Mon, 22 Jun 2020 14:24:29 +0000 (16:24 +0200)
committerRadoslaw Zarzynski <rzarzyns@redhat.com>
Tue, 23 Jun 2020 08:16:14 +0000 (10:16 +0200)
The problem this commit deals with is that alienized
set of some `src/common` has included all `crush_srcs`:

  ```
  set(crush_srcs
    builder.c
    mapper.c
    crush.c
    hash.c
    CrushWrapper.cc
    CrushCompiler.cc
    CrushTester.cc
    CrushLocation.cc)
  ```

while only `CrushLocation.cc` has been altered with
the `TOPNSPC` macro -- other files lack the namespace
differentiation. This leads to a conflict with
`libcrimson-common.a` which includes the same files:

  ```
  add_library(crimson-common STATIC
  ...
    ${PROJECT_SOURCE_DIR}/src/crush/builder.c
    ${PROJECT_SOURCE_DIR}/src/crush/mapper.c
    ${PROJECT_SOURCE_DIR}/src/crush/crush.c
    ${PROJECT_SOURCE_DIR}/src/crush/hash.c
    ${PROJECT_SOURCE_DIR}/src/crush/CrushWrapper.cc
    ${PROJECT_SOURCE_DIR}/src/crush/CrushCompiler.cc
    ${PROJECT_SOURCE_DIR}/src/crush/CrushTester.cc
    ${PROJECT_SOURCE_DIR}/src/crush/CrushLocation.cc
  ```

Another, potential problem is linking with a variant
built `WITH_ALIEN` setting.

Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
src/crimson/os/alienstore/CMakeLists.txt

index f616dcc819080e04a21d41e96ba6095960847643..7d519e1578d1b5b2a0efb4eea4ea03cdeec7eb8c 100644 (file)
@@ -24,6 +24,7 @@ list(APPEND crimson_alien_srcs
   ${PROJECT_SOURCE_DIR}/src/common/TrackedOp.cc
   ${PROJECT_SOURCE_DIR}/src/common/WorkQueue.cc
   ${PROJECT_SOURCE_DIR}/src/common/util.cc
+  ${PROJECT_SOURCE_DIR}/src/crush/CrushLocation.cc
   ${PROJECT_SOURCE_DIR}/src/global/global_context.cc
   ${PROJECT_SOURCE_DIR}/src/os/ObjectStore.cc
   ${PROJECT_SOURCE_DIR}/src/os/bluestore/Allocator.cc
@@ -42,7 +43,6 @@ list(APPEND crimson_alien_srcs
 
 add_library(crimson-alienstore STATIC ${crimson_alien_srcs}
   $<TARGET_OBJECTS:compressor_objs>
-  $<TARGET_OBJECTS:crush_objs>
   $<TARGET_OBJECTS:common_prioritycache_obj>)
 
 target_compile_definitions(crimson-alienstore PRIVATE -DWITH_SEASTAR -DWITH_ALIEN)