khodowany 940fead905
publish / publish (push) Successful in 11m35s
Editor
2026-09-10 18:53:56 -05:00
2026-09-10 18:53:56 -05:00
2026-09-10 09:21:04 -05:00
2026-09-04 19:30:11 -05:00
2026-09-10 18:53:56 -05:00
2026-09-10 18:53:56 -05:00
2026-09-04 19:30:11 -05:00
2026-09-10 18:53:56 -05:00
2026-09-10 18:53:56 -05:00
2026-09-04 19:30:11 -05:00
2026-09-10 18:53:56 -05:00
2026-09-10 09:21:04 -05:00
2026-09-10 18:53:56 -05:00
2026-09-04 19:30:11 -05:00
2026-09-10 18:53:56 -05:00
2026-09-10 18:53:56 -05:00

Modulus

Modulus is the shared C++23 foundation library and build tooling used by the khodo Product Vamp repositories. It provides small runtime utilities, Conan profiles, CMake package integration, editor configuration generation, typed LSP compile-database setup, and bridge targets for the external libraries needed by Product Vamp.

The core modulus::modulus target requires only Boost.JSON. Optional bridges are loaded when requested:

find_package(modulus CONFIG REQUIRED COMPONENTS openssl)
target_link_libraries(app PRIVATE modulus::modulus modulus::openssl)

Available components are boost_json, openssl, sqlite, raylib, and miniaudio. Existing package discovery can also be followed by modulus_require_openssl() (or the corresponding bridge helper). Source builds opt in with MODULUS_WITH_OPENSSL, MODULUS_WITH_SQLITE, MODULUS_WITH_RAYLIB, and MODULUS_WITH_MINIAUDIO.

Conan consumers must enable the matching modulus/*:with_openssl, with_sqlite, with_raylib, or with_miniaudio option to add that dependency to the graph. Applications combining several bridge consumers should set the union of these options on their direct Modulus requirement. All four options default to false.

Build

Use the checked-in tools directly inside CI or a compatible build environment:

MODULUS_DIRECT=1 ./tools/configure.py --target x86_64_gcc12_release
./tools/build.py --target x86_64_gcc12_release
./tools/test.py --target x86_64_gcc12_release

Outside that environment, downstream repos use python3 modulus.py <command> to fetch the public modulus/latest package from the khodo Conan registry and export the tool wrappers into build/build_tools/.

build automatically configures a target when CMake metadata is missing. Run configure explicitly when you want to force a reconfigure or refresh dependencies.

Refresh clangd compile databases with:

./tools/lsp.py

Product repos can add typed extra CMake compile databases under tooling.lsp.compile_databases; this is intended for cases like Product Vamp's Pico firmware tree.

Editor Configuration

modulus.json is the source for generated .clangd, .clang-format, and pyrightconfig.json files. Configure, LSP refresh, and tooling export regenerate them only when their content changes. Keep these generated files ignored; customize tooling.editor instead:

{
  "tooling": {
    "editor": {
      "clangd": [
        {"CompileFlags": {"CompilationDatabase": "build/native"}},
        {"If": {"PathMatch": "src/firmware/.*"}, "CompileFlags": {"CompilationDatabase": "build/firmware"}}
      ],
      "clang_format": {"DisableFormat": true},
      "pyright": {"include": ["tools", "conanfile.py"]}
    }
  }
}

Each supplied entry replaces that file's entire configuration. Omitted entries use Modulus defaults: the default target's build directory for clangd, -Wall/-Wextra, disabled clang-tidy and formatting, and Python paths for the bootstrap, recipe, and exported tools. Entries use the editors' own configuration keys. LLVM files use JSON-compatible YAML, with separate documents for clangd fragments.

The authored cmake/ directory belongs in Git. CMakeFiles/, compiler caches, and generated sources belong in build directories. Modulus rejects project/source-root output directories before clearing configure or LSP caches. Conan may still use its own isolated build folders. Existing build caches are retained; they are not source files.

Package

Create Conan packages with:

./tools/package.py --all

Publishing requires credentials only for the upload step:

CONAN_USER=<user> \
CONAN_TOKEN=<token> \
MODULUS_CONAN_UPLOAD=1 \
MODULUS_ALLOW_PACKAGE_REPLACE=1 \
./tools/package.py --all --replace

The default public Conan remote is:

https://git.thyme-labs.com/api/packages/khodo/conan

Generic application artifacts default to:

https://git.thyme-labs.com/api/packages/khodo/generic

Configure/build/test do not require package credentials for public packages.

License

Modulus is released under the MIT License.

S
Description
No description provided
Readme MIT 450 KiB
Languages
Python 75.9%
C++ 17.4%
Lua 4.1%
CMake 2.2%
Dockerfile 0.4%