From ea039aa16ea373e58b2d827aef2496423f8704d4 Mon Sep 17 00:00:00 2001 From: Radoslaw Zarzynski Date: Mon, 22 Jun 2020 16:24:29 +0200 Subject: [PATCH] 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 --- src/crimson/os/alienstore/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/crimson/os/alienstore/CMakeLists.txt b/src/crimson/os/alienstore/CMakeLists.txt index f616dcc8190..7d519e1578d 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) -- 2.39.5