mirror of
https://github.com/hanzoai/datastore.git
synced 2026-09-26 13:55:07 +00:00
build: point the last 13 contrib cmake files at Datastore_SOURCE_DIR
Configure now COMPLETES ("Configuring done (19.3s)") and the build died in the
generate step instead, on "No SOURCES given to target" for _zxc, _zxc_*_avx2/512,
_simdutf and libdeflate.
The targets are not empty; the paths were. CMake defines <PROJECT>_SOURCE_DIR,
and CMakeLists.txt:18 declares project(Datastore), so ClickHouse_SOURCE_DIR is
simply an undefined variable that expands to the empty string. Every contrib
wrapper still spelling it that way built its source path as "/contrib/zxc" or
"/contrib/simdutf/src" — rooted at /, not at the source tree — so the globs
matched nothing and add_library was handed an empty list. An undefined variable
is not an error in CMake, which is why this surfaced as a missing-sources
complaint about the target rather than a bad path.
This is the same unfinished rename as the previous commit wearing different
clothes. Swept both spellings across every in-repo cmake file: exactly two tokens,
ClickHouse_SOURCE_DIR and ClickHouse_BINARY_DIR, 23 occurrences in 13 files, all
of them contrib/*-cmake wrappers plus src/CMakeLists.txt. The submodules
themselves are untouched — the wrappers are ours, contrib/<name>-cmake is not a
.gitmodules path.
Renamed rather than aliased. A one-line set(ClickHouse_SOURCE_DIR
${Datastore_SOURCE_DIR}) in the root would also have worked and would cost less
on the next upstream merge, but the tree already carries hundreds of
Datastore_SOURCE_DIR uses in these same directories: the choice to rename was
made when the project was renamed, and these 13 files are the remainder of that
job, not a new decision. Two spellings for one path is the thing that produced
this bug in the first place.
This commit is contained in:
@@ -108,7 +108,7 @@ target_compile_definitions(_flatbuffers PRIVATE -DFLATBUFFERS_LOCALE_INDEPENDENT
|
||||
# the buffers directly to/from ClickHouse columns. The include base ".../cpp/src" lets the code
|
||||
# use <generated/Message_generated.h> while the generated headers' own relative includes resolve.
|
||||
add_library(_arrow_ipc_metadata INTERFACE)
|
||||
target_include_directories(_arrow_ipc_metadata SYSTEM INTERFACE "${ClickHouse_SOURCE_DIR}/contrib/arrow/cpp/src")
|
||||
target_include_directories(_arrow_ipc_metadata SYSTEM INTERFACE "${Datastore_SOURCE_DIR}/contrib/arrow/cpp/src")
|
||||
target_link_libraries(_arrow_ipc_metadata INTERFACE _flatbuffers)
|
||||
add_library(ch_contrib::arrow_ipc_metadata ALIAS _arrow_ipc_metadata)
|
||||
|
||||
|
||||
@@ -82,12 +82,12 @@ if (USE_MUSL)
|
||||
string(REGEX REPLACE "-isystem [^ ]*musl[^ ]*" "" CMAKE_C_FLAGS_STRIPPED "${CMAKE_C_FLAGS}")
|
||||
string(REGEX REPLACE "-isystem [^ ]*musl[^ ]*" "" CMAKE_CXX_FLAGS_STRIPPED "${CMAKE_CXX_FLAGS}")
|
||||
|
||||
set(MUSL_STUB_INCLUDE_DIR "${ClickHouse_SOURCE_DIR}/contrib/musl-cmake/include")
|
||||
set(MUSL_GENERATED_DIR "${ClickHouse_BINARY_DIR}/contrib/musl-cmake/include")
|
||||
set(MUSL_INCLUDE_DIR "${ClickHouse_SOURCE_DIR}/contrib/musl/include")
|
||||
set(MUSL_ARCH_DIR "${ClickHouse_SOURCE_DIR}/contrib/musl/arch/${MUSL_ARCH}")
|
||||
set(MUSL_GENERIC_DIR "${ClickHouse_SOURCE_DIR}/contrib/musl/arch/generic")
|
||||
set(MUSL_KERNEL_HEADERS_DIR "${ClickHouse_BINARY_DIR}/contrib/musl-cmake/kernel-headers")
|
||||
set(MUSL_STUB_INCLUDE_DIR "${Datastore_SOURCE_DIR}/contrib/musl-cmake/include")
|
||||
set(MUSL_GENERATED_DIR "${Datastore_BINARY_DIR}/contrib/musl-cmake/include")
|
||||
set(MUSL_INCLUDE_DIR "${Datastore_SOURCE_DIR}/contrib/musl/include")
|
||||
set(MUSL_ARCH_DIR "${Datastore_SOURCE_DIR}/contrib/musl/arch/${MUSL_ARCH}")
|
||||
set(MUSL_GENERIC_DIR "${Datastore_SOURCE_DIR}/contrib/musl/arch/generic")
|
||||
set(MUSL_KERNEL_HEADERS_DIR "${Datastore_BINARY_DIR}/contrib/musl-cmake/kernel-headers")
|
||||
|
||||
# The regex above strips every "-isystem ...musl..." entry, so we must reconstruct the full
|
||||
# musl header surface that cmake/linux/toolchain-*-musl.cmake puts into CMAKE_*_FLAGS via
|
||||
|
||||
@@ -91,8 +91,8 @@ if (USE_MUSL)
|
||||
add_dependencies(cxx musl-headers)
|
||||
# The arch dirs are not in the toolchain flags to avoid include order issues in musl's own build.
|
||||
target_include_directories(cxx SYSTEM BEFORE PRIVATE
|
||||
"${ClickHouse_SOURCE_DIR}/contrib/musl/arch/${MUSL_ARCH}"
|
||||
"${ClickHouse_SOURCE_DIR}/contrib/musl/arch/generic"
|
||||
"${Datastore_SOURCE_DIR}/contrib/musl/arch/${MUSL_ARCH}"
|
||||
"${Datastore_SOURCE_DIR}/contrib/musl/arch/generic"
|
||||
)
|
||||
endif ()
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ if (USE_MUSL)
|
||||
add_dependencies(cxxabi musl-headers)
|
||||
# The arch dirs are not in the toolchain flags to avoid include order issues in musl's own build.
|
||||
target_include_directories(cxxabi SYSTEM BEFORE PRIVATE
|
||||
"${ClickHouse_SOURCE_DIR}/contrib/musl/arch/${MUSL_ARCH}"
|
||||
"${ClickHouse_SOURCE_DIR}/contrib/musl/arch/generic"
|
||||
"${Datastore_SOURCE_DIR}/contrib/musl/arch/${MUSL_ARCH}"
|
||||
"${Datastore_SOURCE_DIR}/contrib/musl/arch/generic"
|
||||
)
|
||||
endif()
|
||||
|
||||
@@ -5,7 +5,7 @@ if (NOT ENABLE_LIBDEFLATE)
|
||||
return()
|
||||
endif()
|
||||
|
||||
set(LIBDEFLATE_SOURCE_DIR "${ClickHouse_SOURCE_DIR}/contrib/libdeflate")
|
||||
set(LIBDEFLATE_SOURCE_DIR "${Datastore_SOURCE_DIR}/contrib/libdeflate")
|
||||
|
||||
# Architecture-specific code is pulled in via headers from these translation units, so the same
|
||||
# source list builds on every target; the per-arch cpu_features.c files compile to nothing on a
|
||||
|
||||
@@ -47,7 +47,7 @@ if (USE_MUSL)
|
||||
add_dependencies(unwind musl-headers)
|
||||
# The arch dirs are not in the toolchain flags to avoid include order issues in musl's own build.
|
||||
target_include_directories(unwind SYSTEM BEFORE PRIVATE
|
||||
"${ClickHouse_SOURCE_DIR}/contrib/musl/arch/${MUSL_ARCH}"
|
||||
"${ClickHouse_SOURCE_DIR}/contrib/musl/arch/generic"
|
||||
"${Datastore_SOURCE_DIR}/contrib/musl/arch/${MUSL_ARCH}"
|
||||
"${Datastore_SOURCE_DIR}/contrib/musl/arch/generic"
|
||||
)
|
||||
endif()
|
||||
|
||||
@@ -5,5 +5,5 @@ if (NOT ENABLE_WAGYU)
|
||||
endif()
|
||||
|
||||
add_library(_mapbox_geometry INTERFACE)
|
||||
target_include_directories(_mapbox_geometry SYSTEM BEFORE INTERFACE ${ClickHouse_SOURCE_DIR}/contrib/mapbox-geometry/include)
|
||||
target_include_directories(_mapbox_geometry SYSTEM BEFORE INTERFACE ${Datastore_SOURCE_DIR}/contrib/mapbox-geometry/include)
|
||||
add_library(ch_contrib::mapbox_geometry ALIAS _mapbox_geometry)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
set(MUSL_SOURCE_DIR "${ClickHouse_SOURCE_DIR}/contrib/musl")
|
||||
set(MUSL_SOURCE_DIR "${Datastore_SOURCE_DIR}/contrib/musl")
|
||||
|
||||
# MUSL_ARCH is musl's name for the target architecture (the arch/<MUSL_ARCH>
|
||||
# directory in the musl sources), set by cmake/linux/toolchain-*-musl.cmake.
|
||||
|
||||
@@ -5,8 +5,8 @@ if (NOT ENABLE_SIMDUTF)
|
||||
return()
|
||||
endif()
|
||||
|
||||
set(SIMDUTF_INCLUDE_DIR "${ClickHouse_SOURCE_DIR}/contrib/simdutf/include")
|
||||
set(SIMDUTF_SRC_DIR "${ClickHouse_SOURCE_DIR}/contrib/simdutf/src")
|
||||
set(SIMDUTF_INCLUDE_DIR "${Datastore_SOURCE_DIR}/contrib/simdutf/include")
|
||||
set(SIMDUTF_SRC_DIR "${Datastore_SOURCE_DIR}/contrib/simdutf/src")
|
||||
set(SIMDUTF_SRC "${SIMDUTF_SRC_DIR}/simdutf.cpp")
|
||||
|
||||
add_library(_simdutf ${SIMDUTF_SRC})
|
||||
|
||||
@@ -12,9 +12,9 @@ endif()
|
||||
# It must be updated when the library is updated. Refer to contrib/sz3/README.md for that (section #Installation).
|
||||
# Turn off ska hash because ska::unordered_map (this is inner hash map) doesn't work with UB sanitizer.
|
||||
set(SZ3_USE_SKA_HASH OFF)
|
||||
set(SZ3_PROJECT_DIR "${ClickHouse_SOURCE_DIR}/contrib/sz3")
|
||||
set(SZ3_PROJECT_DIR "${Datastore_SOURCE_DIR}/contrib/sz3")
|
||||
set(SZ3_SOURCE_DIR "${SZ3_PROJECT_DIR}/include")
|
||||
set(SZ3_VERSION_DIR "${ClickHouse_SOURCE_DIR}/contrib/sz3-cmake")
|
||||
set(SZ3_VERSION_DIR "${Datastore_SOURCE_DIR}/contrib/sz3-cmake")
|
||||
|
||||
add_library(_sz3 INTERFACE)
|
||||
target_include_directories(_sz3 SYSTEM INTERFACE ${SZ3_SOURCE_DIR})
|
||||
|
||||
@@ -5,7 +5,7 @@ if (NOT ENABLE_WAGYU)
|
||||
endif()
|
||||
|
||||
add_library(_wagyu INTERFACE)
|
||||
target_include_directories(_wagyu SYSTEM BEFORE INTERFACE ${ClickHouse_SOURCE_DIR}/contrib/wagyu/include)
|
||||
target_include_directories(_wagyu SYSTEM BEFORE INTERFACE ${Datastore_SOURCE_DIR}/contrib/wagyu/include)
|
||||
# wagyu's headers include <mapbox/geometry/{point,box,polygon,...}.hpp> from mapbox-geometry.
|
||||
target_link_libraries(_wagyu INTERFACE ch_contrib::mapbox_geometry)
|
||||
add_library(ch_contrib::wagyu ALIAS _wagyu)
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
# of zxc's build that matter: the per-ISA "variant" objects plus the scalar
|
||||
# core, combined into a single static library.
|
||||
|
||||
set(LIBRARY_DIR "${ClickHouse_SOURCE_DIR}/contrib/zxc")
|
||||
set(LIBRARY_DIR "${Datastore_SOURCE_DIR}/contrib/zxc")
|
||||
set(SRC_DIR "${LIBRARY_DIR}/src/lib")
|
||||
|
||||
set(ZXC_INCLUDE_DIRS
|
||||
|
||||
+1
-1
@@ -925,7 +925,7 @@ if (ENABLE_TESTS)
|
||||
)
|
||||
|
||||
target_compile_definitions(unit_tests_dbms PRIVATE
|
||||
CLICKHOUSE_TESTS_CONFIG_DIR="${ClickHouse_SOURCE_DIR}/tests/config"
|
||||
CLICKHOUSE_TESTS_CONFIG_DIR="${Datastore_SOURCE_DIR}/tests/config"
|
||||
)
|
||||
|
||||
target_link_libraries(unit_tests_dbms PRIVATE
|
||||
|
||||
Reference in New Issue
Block a user