Files
zeekay 3094cd1739 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.
2026-08-06 14:18:48 -07:00

24 lines
1.0 KiB
CMake

option(ENABLE_SZ3 "Enable SZ3" ${ENABLE_LIBRARIES})
if (NOT ENABLE_SZ3)
message (STATUS "Not using SZ3")
return()
endif()
# SZ3 is still under development, it writes its current version into the serialized compressed data.
# Therefore, update SZ3 with care to avoid breaking existing persistencies.
# File contrib/sz3-cmake/SZ3/version.hpp was statically generated from version.hpp.in in contrib/sz3.
# 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 "${Datastore_SOURCE_DIR}/contrib/sz3")
set(SZ3_SOURCE_DIR "${SZ3_PROJECT_DIR}/include")
set(SZ3_VERSION_DIR "${Datastore_SOURCE_DIR}/contrib/sz3-cmake")
add_library(_sz3 INTERFACE)
target_include_directories(_sz3 SYSTEM INTERFACE ${SZ3_SOURCE_DIR})
target_include_directories(_sz3 SYSTEM INTERFACE ${SZ3_VERSION_DIR})
add_library(ch_contrib::sz3 ALIAS _sz3)