-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
Description
Motivation
Build Impact Analysis
Today, there is no reliable way to answer: "If I change Foo.h, which CMake targets need to rebuild?"
CMake's File API (codemodel-v2) reports source files associated with each target. However, headers
added via install(FILES ...) or glob-based helpers are invisible to the File API — they exist on disk but have no target association in the build graph.
By using FILE_SET HEADERS (CMake 3.23+), every header becomes a first-class source of its target, queryable through the File API.
Selective Builds
With accurate header-to-target mapping, we can build selective build tooling:
- A PR modifies
velox/core/PlanNode.h - Query the File API →
PlanNode.hbelongs to targetvelox_core - Build and test only
velox_coreand its dependents, instead of the entire project
This significantly reduces CI time for targeted changes.
Approach
-
HEADERSkeyword invelox_add_library()— production targets declare their headers explicitly, wired toFILE_SET HEADERSinternally. -
velox_add_test_headers()— lightweight helper for test/benchmark/fuzzer targets using rawadd_library()/add_executable(). -
CI enforcement — a
check-header-ownershippre-commit hook verifies every.hfile undervelox/is referenced in aCMakeLists.txt. New headers without ownership fail CI. -
Compatibility —
VELOX_MONO_LIBRARYmode fully supported. Existingvelox_install_library_headers()kept as fallback. No changes to build output or installed artifacts.
Scope
- ~1,287 headers tracked across ~150 CMakeLists.txt files
- ~65 new INTERFACE targets mirroring BUCK's header-only structure
Future Work
- Build selective build tooling consuming the File API data
Related PR: #16897