mirror of
https://github.com/hanzoai/datastore.git
synced 2026-09-26 13:55:07 +00:00
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.
27 lines
1.2 KiB
CMake
27 lines
1.2 KiB
CMake
option (ENABLE_SIMDUTF "Use simdutf" ${ENABLE_LIBRARIES})
|
|
|
|
if (NOT ENABLE_SIMDUTF)
|
|
message(STATUS "Not using simdutf")
|
|
return()
|
|
endif()
|
|
|
|
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})
|
|
# The umbrella src/simdutf.cpp includes its per-architecture kernel headers
|
|
# (e.g. simdutf/icelake.h) from the src/ directory, so it must be on the
|
|
# private include path in addition to the public include/ directory.
|
|
target_include_directories(_simdutf SYSTEM PUBLIC "${SIMDUTF_INCLUDE_DIR}" PRIVATE "${SIMDUTF_SRC_DIR}")
|
|
|
|
# Like simdjson, simdutf performs its own runtime CPU dispatch. On x86-64-v2
|
|
# (and lower) globally-enabled AVX/AVX2 flags confuse the dispatcher, so disable
|
|
# them and let it pick the best implementation at runtime. For v3+, AVX2 is
|
|
# always available and simdutf can use its Haswell implementation directly.
|
|
if (ARCH_AMD64 AND X86_ARCH_LEVEL VERSION_LESS 3)
|
|
target_compile_options(_simdutf PRIVATE -mno-avx -mno-avx2)
|
|
endif()
|
|
|
|
add_library(ch_contrib::simdutf ALIAS _simdutf)
|