Skip to content

Version 2.1.0

Choose a tag to compare

@StormBytePP StormBytePP released this 16 Oct 18:13
· 14 commits to master since this release

[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:

Added

  • BACKEND=binary publishes a prebuilt archive into the shared prefix. The third argument of buildmaster_component is an http://, https:// or file:// URL. The filename is the cache key under <BUILDMASTER_DATADIR>/downloads; an existing file is a hit and there is no hash. The archive root is an install tree. Unpack extracts to a stage, copies every top-level entry except lib/ and lib64/, then include(GNUInstallDirs) and copies whichever of those two exists into that libdir. The script sets CMAKE_SYSTEM_NAME and the pointer size first, because cmake -P has neither and the module would warn. If both exist, the one already named for this machine wins, so a zip built with lib/ works on a lib64 host and the reverse. FILES= source trees are not rewritten. Mode is static or shared. Each produced spec becomes an IMPORTED library on the component id. On Windows the import library follows that libdir and the .dll stays in bin/. ALIAS= points at the id. buildmaster_group_add, buildmaster_depend and buildmaster_link accept the id. buildmaster_link puts the dest on the id's INTERFACE and makes <id>_install wait on that dest, so the dest archive is downloaded and extracted first. NOINSTALL, REPACK, WHOLE, FILES=, GIT=, SOURCE=, headers, executable and meta membership are FATAL. The fourth argument is ignored. Harness binary-backend builds two shared libraries, zips those prefixes, forces the opposite libdir, links and runs an executable that needs both, and checks that installing the upper id also extracts the lower one. The nested project links the file in that libdir by name (widget.lib or libwidget.so): find_library on Windows does not search lib64. Negative configures cover the FATAL flags.

Fixed

  • File-tool paths were never initialized. tools/file/init_vars.cmake was not included, so BUILDMASTER_TOOLS_FILE_SRCDIR was empty and a cached download looked for /templates/file_download.cmake.in. tools/file/helpers.cmake includes it. The same include exports the path into the toolchain.
  • Harness binary-backend finds widget_drive.exe on Windows. The driver is cmake -P, which does not set CMAKE_EXECUTABLE_SUFFIX. The consumer project writes the real executable path, and the driver runs that path.
  • Stamp tree hashing records symbolic links instead of following them. _bm_stamp_walk checks IS_SYMLINK before a directory or a regular file. The digest line is the relative path, the kind (symlink-file, symlink-directory or symlink-dangling) and the target text from file(READ_SYMLINK). The link is not opened and its target is not walked, so a directory link and a dangling link never reach file(SHA256). Retargeting a file link changes the digest even when both targets have the same bytes. A regular file is still relpath digest, so a tree with no links does not change key. Harness stamp-symlinks covers file links, directory links, dangling links and a changed target.
  • Nested CMake installs into this machine's libdir. The nested configure received the prefix but not CMAKE_INSTALL_LIBDIR. The child ran GNUInstallDirs on its own, so on Debian it installed into lib/ while BuildMaster renamed inside lib64/ after the harness forced that directory. The configure now passes -DCMAKE_INSTALL_LIBDIR. Meson already passed --libdir.