Repository navigation
Version 2.0.2
[Summary]
BuildMaster is a small CMake DSL for a graph of other people’s builds.
You declare each dependency once — how it is produced, what it waits on — and the parent gets one shared prefix instead of a pile of ExternalProject / FetchContent glue.
CMake and Meson trees are first-class.
Typical use: add the submodule, add_subdirectory, declare components, then depend / link.
Declaration order does not matter.
The public surface is ten commands on purpose; everything else is internal.
If you landed here from a release link and have not read the tree:
- How to write a component, every optstr key, and the contract: README.md
- The ten names, and nothing else: public_functions.md
- Porting an older caller: MIGRATE.md
Added
- Static link sidecar.
write_onealways emitslinks/<id>_static.txt(set(_BM_STATIC_LINK …)).MODE=staticfills it withLINK=tokens andbuildmaster_linkdest ids; shared / headers / executable write an empty list. Flatten reads the sidecar if it exists: dest ids with alinks/<dest>.cmakeare walked (-L+ produced names); raw tokens (m,-framework CoreFoundation) go onto the host as-is. A shared.sostill absorbs PRIVATE deps; consumers of that DSO see an empty sidecar and do not inheritpq/ SDK libs. Effective nested reconfigure (stamp miss and a realcmake -S) deleteslinks/<id>.cmakeandlinks/<id>_static.txtbefore rewrite; stamp / reuse skip leaves them. Fixturelinks-static-closure: staticsl-dbPRIVATE-linkssl-pq, the parent exe links onlysl-db, both archives appear on the line. - In-process CMake host backend (
BACKEND=host).buildmaster_componentaccepts a source-file list and immediately creates a realSTATICorSHAREDtarget for ordinary CMake properties and options. BuildMaster graph links are applied after all components materialize;LINK=isPUBLICfor static targets andPRIVATEfor shared ones, so system libraries and component dependencies can reach final consumers without usingREPACKas a workaround.REPACKremains for intentionally mergingNOINSTALLstatic members. Fixturehost-crypto-chaincovers the host target and deferred dependency chain.
Fixed
- A reconfigure no longer skips the ids its own build dir published. When ninja re-ran CMake inside a nested project (a
CONFIGURE_DEPENDSglob mismatch, or alinks/*.cmakerewritten by the parent),buildmaster_componenttreated the leftoverlinks/<id>.cmakeof every dependency that same project had configured as "already built by" another process. Their<id>_build/<id>_installstages vanished from the nested graph and aBACKEND=hostlibrary compiled before its dependencies were installed (missing headers). A top-levelcmake <builddir>hit the same skip. Each build dir now records the ids it published inbm-owned-links.txt, and a reconfigure configures those again. Fixturehost-nested-reconfiguredrives configure → build → build → forced nested reconfigure → top-level reconfigure. - A parent no longer rewrites the links file its nested project wrote for the same id. When a
cmakecomponent's nested BuildMaster project declares that same id (for example withBACKEND=host), both processes wrotelinks/<id>.cmakewith different content. The parent rewrite made the nestedbuild.ninjastale, and the next build re-ran CMake in the nested project and then in the parent. Links files now record their writer's binary dir (_BM_LINKS_WRITER); the parent keeps a file written from the component's own build dir unless it adds dests. - List values in the toolchain dump stay on one line.
_bm_tc_export/_bm_tc_export_rawstored each line in a CMake list property, so a value containing;(for exampleBUILDMASTER_KNOWN_TOOLCHAINS) was split into one line per item. Nested configures then cached a multi-line value and warnedValue of BUILDMASTER_KNOWN_TOOLCHAINS contained a newline; truncating. Semicolons are now escaped in the property and the dump writesset(X "a;b").