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.
4821set (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 )
5528endif ()
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 ()
8450endif ()
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.
8954if (NOT DEFINED NIMBLE_BUILD_TESTING)
9055 set (NIMBLE_BUILD_TESTING ${VELOX_BUILD_TESTING} )
9156endif ()
0 commit comments