Summary
Support building NeuG extensions outside the NeuG source tree (out-of-tree), so an extension repo can keep NeuG as a git submodule / sibling checkout and compile against it without copying sources into neug/extension/.
Motivation
Extension authors typically want a layout like:
my-extension/
neug/ # submodule or sibling
extension_config.cmake
CMakeLists.txt
src/
Today, only in-tree extensions under extension/ (e.g. parquet, gds, pattern_matching, httpfs) are wired into the NeuG CMake build via BUILD_EXTENSIONS. External repos need a first-class registration hook.
Proposed design
- Add a CMake cache variable
NEUG_EXTENSION_CONFIGS: semicolon-separated list of extension_config.cmake files.
- Provide
cmake/neug_extension.cmake with neug_extension_load(<name> SOURCE_DIR <path>) to register an external extension source tree.
- When configuring NeuG, include those config files; for each name in
BUILD_EXTENSIONS:
- builtins →
add_subdirectory(extension/<name>)
- registered external →
add_subdirectory(<SOURCE_DIR>) into the NeuG build tree
Example:
# my-extension/extension_config.cmake
neug_extension_load(wiggle
SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}
)
cmake -S neug -B build \
-DBUILD_EXTENSIONS=wiggle \
-DNEUG_EXTENSION_CONFIGS=/path/to/my-extension/extension_config.cmake
Artifacts land under the NeuG build dir, e.g. build/extension/wiggle/libwiggle.neug_extension.
Implementation
Tracking PR: #745
Summary
Support building NeuG extensions outside the NeuG source tree (out-of-tree), so an extension repo can keep NeuG as a git submodule / sibling checkout and compile against it without copying sources into
neug/extension/.Motivation
Extension authors typically want a layout like:
Today, only in-tree extensions under
extension/(e.g.parquet,gds,pattern_matching,httpfs) are wired into the NeuG CMake build viaBUILD_EXTENSIONS. External repos need a first-class registration hook.Proposed design
NEUG_EXTENSION_CONFIGS: semicolon-separated list ofextension_config.cmakefiles.cmake/neug_extension.cmakewithneug_extension_load(<name> SOURCE_DIR <path>)to register an external extension source tree.BUILD_EXTENSIONS:add_subdirectory(extension/<name>)add_subdirectory(<SOURCE_DIR>)into the NeuG build treeExample:
Artifacts land under the NeuG build dir, e.g.
build/extension/wiggle/libwiggle.neug_extension.Implementation
Tracking PR: #745