This page collects the normal operating sequences for kbuild.
Empty Directory To Scaffolded Repo
- Create starter config in the empty directory.
- Edit the config.
- Scaffold the repo.
- Initialize git if needed.
- Install local
vcpkg if the repo uses it.
kbuild --kbuild-config
# edit ./.kbuild.json
kbuild --kbuild-init
kbuild --git-initialize
kbuild --vcpkg-install
Notes:
--kbuild-init requires the directory to be otherwise empty except for
kbuild.json and .kbuild.json.
- scaffolded SDK repos include core CMake files, demo trees, test placeholders,
and optional
vcpkg/vcpkg.json.
Existing Repo Day-To-Day
Normal build:
kbuild --build-latest
Fast rebuild from an existing cache:
kbuild --build-latest --cmake-no-configure
kbuild --build-demos --cmake-no-configure
Fresh rebuild:
kbuild --clean-latest
kbuild --build-latest
Explicit Demo Validation
Build demos from config order:
kbuild --build-demos
Build an explicit chain:
kbuild --build dev --build-demos sdk/alpha sdk/beta exe/core
Why order matters:
- demos can consume the core SDK install under
build/<slot>/sdk
- demos can consume SDK dependencies from
cmake.dependencies
- later demos can consume SDKs installed by earlier demos in the same run
Multi-Repo SDK Stack
Use one shared slot name across the related repos, then build dependencies
before consumers.
Example:
cd ../kcli
kbuild --build dev
cd ../ktrace
kbuild --build dev --vcpkg-install
cd ../myproject
kbuild --build dev --vcpkg-install
kbuild --build dev --build-demos
This works cleanly when cmake.dependencies uses version-aware prefixes such
as:
"dependencies": {
"KcliSDK": {
"prefix": "../kcli/build/{version}/sdk"
},
"KTraceSDK": {
"prefix": "../ktrace/build/{version}/sdk"
}
}
Git Bring-Up
After scaffold generation and remote creation:
kbuild --git-initialize
For later full syncs:
kbuild --git-sync "Update project docs"
kbuild refuses to use a parent git worktree for sync operations. The repo
must be rooted at the current directory.
Vcpkg Bring-Up
For repos that define a vcpkg object:
kbuild --vcpkg-install
This prepares:
vcpkg/src
vcpkg/build/downloads
vcpkg/build/binary-cache
If you only need to update the manifest baseline from the checked-out vcpkg
commit:
kbuild --vcpkg-sync-baseline
When To Stop And Reconfigure
Run a configure pass again when:
- toolchain settings changed
- dependency prefixes changed
vcpkg state changed
- linkage mode changed
- you cleaned the build slot
Use:
kbuild --build-latest --cmake-configure
For the exhaustive command semantics and failure cases, see
kbuild.md.