Skip to content

Commit 1a67ea2

Browse files
committed
wip: D7 cleanup
1 parent e133663 commit 1a67ea2

3 files changed

Lines changed: 24 additions & 81 deletions

File tree

velox/dwio/nimble/CMakeLists.txt

Lines changed: 6 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -12,38 +12,11 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
# Nimble has two entry points: the Velox build reaches it through
16-
# velox/dwio/CMakeLists.txt when VELOX_ENABLE_NIMBLE=ON, and the standalone
17-
# Nimble repository builds Velox as a submodule and adds this directory
18-
# directly. Dependency resolution and option handling therefore live here, so
19-
# both entry points configure Nimble identically.
15+
# Nimble is reached only through velox/dwio/CMakeLists.txt when
16+
# VELOX_ENABLE_NIMBLE=ON. FlatBuffers, OpenZL and the vendored FSST are all
17+
# resolved by the top-level Velox CMakeLists before this point, so this file
18+
# only configures what is specific to Nimble.
2019

21-
# FlatBuffers is not a Velox dependency; Nimble is its only consumer.
22-
find_package(flatbuffers QUIET)
23-
set(NIMBLE_NEED_BUNDLED_BUILD_FLAT_BUFFERS FALSE)
24-
if(flatbuffers_FOUND)
25-
if(flatbuffers_VERSION VERSION_LESS "22.9.4")
26-
set(NIMBLE_NEED_BUNDLED_BUILD_FLAT_BUFFERS TRUE)
27-
endif()
28-
else()
29-
# Fallback to old FlatBuffers (< 2.0.0), which used a capitalised name.
30-
find_package(Flatbuffers QUIET)
31-
if(NOT Flatbuffers_FOUND)
32-
message(
33-
FATAL_ERROR
34-
"Nimble requires FlatBuffers, which was not found. Install it (the "
35-
"scripts/setup-*.sh scripts do this) or reconfigure with "
36-
"-DVELOX_ENABLE_NIMBLE=OFF."
37-
)
38-
endif()
39-
set(NIMBLE_NEED_BUNDLED_BUILD_FLAT_BUFFERS TRUE)
40-
endif()
41-
if(NIMBLE_NEED_BUNDLED_BUILD_FLAT_BUFFERS)
42-
# Old FlatBuffers (< 22.9.4) doesn't provide build_flatbuffers(). So we will
43-
# use the bundled one. We can remove CMake/BuildFlatBuffers once we drop
44-
# support for FlatBuffers < 22.9.4.
45-
include(BuildFlatBuffers)
46-
endif()
4720
# Nimble code expects an upper case suffix to the generated file.
4821
set(FLATBUFFERS_FLATC_SCHEMA_EXTRA_ARGS "--filename-suffix" "Generated")
4922

@@ -54,13 +27,6 @@ if(NOT TARGET absl::flat_hash_map)
5427
velox_resolve_dependency(absl)
5528
endif()
5629

57-
# The standalone Nimble build vendors OpenZL as a git submodule and has already
58-
# added it by this point; the Velox build fetches it instead.
59-
if(NOT TARGET openzl_cpp)
60-
velox_set_source(openzl)
61-
velox_resolve_dependency(openzl)
62-
endif()
63-
6430
# Nimble's OSS build has no access to the Meta-internal compressor. This is read
6531
# by widely included headers (compression/CompressionPolicy.h,
6632
# encodings/legacy/EncodingSelectionPolicy.h), so every translation unit that
@@ -83,9 +49,8 @@ if(VELOX_MONO_LIBRARY AND TARGET velox)
8349
endif()
8450
endif()
8551

86-
# Nimble builds its own tests even when the surrounding Velox build has testing
87-
# disabled: the standalone repo sets VELOX_BUILD_MINIMAL_WITH_DWIO=ON, which
88-
# forces VELOX_BUILD_TESTING=OFF, yet still needs `make unittest` to work.
52+
# Nimble's tests follow Velox's testing switch. The separate variable is kept so
53+
# a build can opt into Nimble's tests alone.
8954
if(NOT DEFINED NIMBLE_BUILD_TESTING)
9055
set(NIMBLE_BUILD_TESTING ${VELOX_BUILD_TESTING})
9156
endif()

velox/dwio/nimble/compression/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ target_link_libraries(
2525
nimble_common
2626
Folly::folly
2727
lz4
28-
openzl
29-
openzl_cpp
28+
OpenZL::openzl
29+
OpenZL::openzl_cpp
3030
)

velox/dwio/nimble/encodings/CMakeLists.txt

Lines changed: 16 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -43,44 +43,22 @@ add_library(
4343
views/HuffmanEncodingView.h
4444
)
4545

46-
set(FSST_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../third-party/fsst")
47-
if(NOT TARGET fsst AND EXISTS "${FSST_SOURCE_DIR}/CMakeLists.txt")
48-
add_subdirectory("${FSST_SOURCE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/fsst")
49-
endif()
50-
if(NOT TARGET fsst)
51-
include(FetchContent)
52-
FetchContent_Declare(
53-
fsst
54-
GIT_REPOSITORY https://github.com/cwida/fsst.git
55-
GIT_TAG 50dd308befd5121bd1121428a833f42cce6e1f9d
56-
)
57-
FetchContent_MakeAvailable(fsst)
58-
set(FSST_SOURCE_DIR "${fsst_SOURCE_DIR}")
59-
endif()
60-
61-
if(TARGET fsst)
62-
target_include_directories(fsst PUBLIC "${FSST_SOURCE_DIR}")
63-
target_compile_definitions(
64-
fsst
65-
PRIVATE
66-
fsst_create=nimble_fsst_create
67-
fsst_duplicate=nimble_fsst_duplicate
68-
fsst_export=nimble_fsst_export
69-
fsst_destroy=nimble_fsst_destroy
70-
fsst_import=nimble_fsst_import
71-
fsst_decoder=nimble_fsst_decoder
72-
fsst_compress=nimble_fsst_compress
73-
fsst_decompress=nimble_fsst_decompress
74-
)
75-
if(TARGET binary)
76-
set_target_properties(binary PROPERTIES EXCLUDE_FROM_ALL TRUE)
77-
endif()
78-
if(TARGET binary12)
79-
set_target_properties(binary12 PROPERTIES EXCLUDE_FROM_ALL TRUE)
80-
endif()
81-
else()
82-
target_include_directories(nimble_encodings PUBLIC "${FSST_SOURCE_DIR}")
83-
endif()
46+
# FSST is vendored at velox/external/fsst and added by velox/CMakeLists.txt
47+
# before this directory, so the target always exists here. Nimble renames FSST's
48+
# exported symbols to avoid clashing with any other copy linked into the same
49+
# binary; PRIVATE keeps the renames on FSST's own translation units.
50+
target_compile_definitions(
51+
fsst
52+
PRIVATE
53+
fsst_create=nimble_fsst_create
54+
fsst_duplicate=nimble_fsst_duplicate
55+
fsst_export=nimble_fsst_export
56+
fsst_destroy=nimble_fsst_destroy
57+
fsst_import=nimble_fsst_import
58+
fsst_decoder=nimble_fsst_decoder
59+
fsst_compress=nimble_fsst_compress
60+
fsst_decompress=nimble_fsst_decompress
61+
)
8462

8563
target_link_libraries(
8664
nimble_encodings

0 commit comments

Comments
 (0)