Skip to content

feat(extension): support out-of-tree extension builds via NEUG_EXTENSION_CONFIGS #747

Description

@liulx20

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

  1. Add a CMake cache variable NEUG_EXTENSION_CONFIGS: semicolon-separated list of extension_config.cmake files.
  2. Provide cmake/neug_extension.cmake with neug_extension_load(<name> SOURCE_DIR <path>) to register an external extension source tree.
  3. 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

Metadata

Metadata

Assignees

Labels

ciCI/CD and build systemextensionExtension system

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions