From: Radoslaw Zarzynski Date: Mon, 22 Jun 2020 14:24:29 +0000 (+0200) Subject: cmake: restrict crush_objs in libcrimson-alienstore.a. X-Git-Tag: v16.1.0~1969^2~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ea039aa16ea373e58b2d827aef2496423f8704d4;p=ceph.git cmake: restrict crush_objs in libcrimson-alienstore.a. 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 --- diff --git a/src/crimson/os/alienstore/CMakeLists.txt b/src/crimson/os/alienstore/CMakeLists.txt index f616dcc81908..7d519e1578d1 100644 --- a/src/crimson/os/alienstore/CMakeLists.txt +++ b/src/crimson/os/alienstore/CMakeLists.txt @@ -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_compile_definitions(crimson-alienstore PRIVATE -DWITH_SEASTAR -DWITH_ALIEN)