Skip to main content

CMake, mcpp, and Xmake for the Hermes host

Decision status · proposed, 21 November 2026. Keep CMake as the production build and packaging reference. Give mcpp the first alternative-tool pilot on a dependency-light Hermes component. Use Xmake's native builder as a second comparison if the maintainers want to test the value of a single frontend with distribution-provided dependencies. No tool migration, new minimum version, or C++26 requirement has been adopted. Hermes source revision · Pilot and decision criteria

The case for mcpp is strongest for a contributor starting with an empty machine who wants a reproducible compiler, module dependencies, and useful incremental builds. A distribution packager needs to install a host binary with Linux file capabilities and a private codec into an existing system. The tools make different promises to those two users.

What an alternative must build​

AreaWhat the workstream actually doesConsequence for a replacement
Host and testssunshine is the internal executable target. test_sunshine compiles the host source list again, removes src/main.cpp, adds SUNSHINE_TESTS, shader paths and coverage flags. Both use C++23.Compare flags, generated inputs and symbols of both consumers. Reusing release objects or a BMI across the two targets requires compatible compilation settings. Host · Tests
Dependency sourcesVendored CMake subprojects include ENet, Simple-Web-Server and libdisplaydevice. Boost requests exactly 1.89.0 with a source fallback. JSON prefers a system package with a 3.11.3 fallback. FFmpeg uses a prepared library set. PyroWave is found via pkg-config and required by package jobs.A registry entry with the same library name is insufficient. Preserve source revisions, patching, linkage, optional-versus-required behavior and the ABI of the installed result. The pinned PyroWave SDK itself uses CMake. Common dependencies · Boost · JSON · SDK recipe
Generated files and mixed languagesThe optional KWin transport checks Wayland, PipeWire and KDE screencast protocol version ≥6. It generates C sources and headers from two XML files and links them with C++20 code. The host also has C sources. The Web UI runs npm and Vite.Model generator inputs/outputs, enablement and invalidation. An XML edit must rebuild its consumers. An older protocol must still allow the intended reduced build. KWin target · Web target
NVIDIA packagesThe package workflow selects CUDA 12.9.1 and an NVCC host GCC 14. Device code is C++17. The Linux configuration selects GPU architectures by toolkit version and filters CUDA's implicit link directories so the older host compiler does not dictate the host executable's runtime. Headless host tests disable CUDA.Preserve the RGBA conversion kernel, architecture coverage, separate host compilers and final link search order. A CUDA-disabled pass leaves the main NVIDIA packaging question open. CI · Linux compile logic · Compiler selection
Native installationThe active Arch package is the root PKGBUILD. Ubuntu and Fedora stage the CMake install tree, rename the binary and service, and check assets. The DEB workflow also reads CMakeCache.txt for the library directory. Native PyroWave gets an absolute private RUNPATH, whereas portable builds use a relative path.Compare package manifests, dependencies, licenses, libdirs, services, broker permissions, assets and installed startup with capabilities. A generic archive or successful executable link answers only part of this. Arch recipe · Staging · RUNPATH · Cache reader

Three tools against those requirements​

CriterionCMake 4.5.x with Ninjamcpp v2026.11.20.1Xmake v3.1.2
Contributor entry pointConfigure and build are separate. Shared presets could encode common choices. Existing scripts still provision SDKs and distribution libraries.mcpp new hello, mcpp build, mcpp test. Managed tooling and dependency resolution reduce manual setup. First use can download payloads.Lua targets, a native build command and integrated package discovery. Can use system libraries or fetch/build configured packages.
Who schedules workCMake drives dependency scanning and generates the Ninja graph.mcpp owns planning and emits Ninja build files. Ninja is still the underlying executor.Native Xmake schedules work itself. A separate project exporter generates Ninja files.
ModulesFILE_SET CXX_MODULES and per-target scanning. Kitware documents the compiler/generator combinations.Module-first manifests, dependency scanning and BMI cache fingerprints. Self-hosting and published workloads give it a credible pilot.Native module rules include compiler-specific scanning/building, partitions and fallback-scanner policies. Evaluate the native graph first.
Linux dependenciesCurrent Hermes rules already encode exact/system/fetched dependencies and install semantics.Lockfile, managed compilers, host/payload pkg-config views and custom build actions. The distro sysroot, pinned PyroWave SDK and NVCC host selection need a Hermes trial.System-only requirements and the pkgconfig:: provider suit a distro-first policy. Package locking is available for remote recipes. Hermes-specific discovery still needs translation.
CUDA and generated outputsAlready represented on the branch. 4.5.x itself has no recorded Hermes trial in this review.Upstream has a CUDA rule and a real-device example, plus declared actions for generated outputs. Verify NVCC, cross-generation on a GPU-less package runner, and staged output.CUDA flags/architecture controls and Lua rules exist. Verify the actual NVCC invocation, XML dependency edges and compiled feature set.
Packaging and maintenanceExisting package scripts, CI, contributor familiarity and an observed successful branch run. Cost is spread across CMake, scripts and distro recipes.mcpp pack supports multiple runtime layouts. A second manifest would need a named owner while host and package parity are evaluated.XPack offers DEB/RPM and other formats. Reuse of existing distro recipes is also possible. Both approaches require validating what is installed.

Versions are pinned for comparison. Kitware published 4.5.0 on 12 November and 4.5.1 on 19 November. A 4.5 experiment can use 4.5.1 while preserving the current declared minimum. Upstream version or feature availability establishes the experiment's starting point. Hermes-specific results are recorded separately. CMake releases · mcpp release · Xmake release

CMake and the effective toolchain floor​

Named modules entered C++ in C++20. The standard library modules std and std.compat are a separate C++23 facility. Whether a build works depends on the compiler, scanner, standard library, generator, and the distribution's installation of those components. Selecting C++26 can enable a specific newer language feature, but does not install a scanner, generate missing library metadata or select the right generator. GCC modules manual · Standard library module proposal

Question for Hermes on LinuxWhat the documentation and checkout establish
Earliest conventional CMake path for named modulesCMake 3.28 added supported module file sets. For Ninja, the current manual lists Ninja ≥1.11, GCC ≥14 or LLVM/Clang ≥16 for scanning. With Clang, ensure a matching clang-scan-deps is available. CMP0155 affects default scanning of C++20+ sources. Keep scanning scoped to the pilot and its importers. 3.28 manual · 4.5 manual · Clang scanner
Does a named module require import std?The pilot can include standard headers in a global module fragment. For import std on Linux, Kitware 4.5 documents GCC ≥15 or Clang ≥18.1.2 with supported libc++/libstdc++ installations, using Ninja generators. Kitware also flags broken libstdc++ module metadata on Ubuntu versions before 26.04. CMake 4.5 does not support header units. Kitware support table and limitations
Would setting the root minimum to 4.5 work with existing distro packages?Ubuntu 24.04 lists CMake 3.28.3 and default G++ 13. Ubuntu 26.04 lists CMake 4.2.3. The stock CMake package in each case is below 4.5. Installing GCC 14 for NVCC is a separate action from selecting the ordinary C++ compiler. Ubuntu 24.04 CMake · G++ · Ubuntu 26.04 CMake
Does the declared 3.20 floor prove all dependency paths work there?The root declares 3.20, but the JSON lookup passes find_package(... GLOBAL), an option introduced in 3.24. Treat 3.20 as a declaration pending an oldest-version test. Neither changing the declaration nor backporting discovery is needed for the research pilot. Root build · JSON lookup · 3.24 changes
Do all active package jobs request Ninja?The host test and DEB/RPM jobs pass -G Ninja. The root Arch PKGBUILD leaves the generator unspecified, so the local environment can select another generator. Unix Makefiles are absent from Kitware's module-scanning support list. Record CMAKE_GENERATOR from the actual Arch build before proposing mandatory imports. PKGBUILD · Build workflow · Generator support

A smaller alternative to a full frontend change is to use CMake targets for the extracted responsibility, then evaluate a contributor preset on the oldest intended reader. Presets address repeated configuration choices. They do not provision the PyroWave SDK or replace the distro's package recipe. CMake presets

Interface design for a pilot. Export the input values and the routing decision. Keep the existing process-facing function defined in its original linkage context. Attaching an existing declaration to a named module can change its mangled name under Clang, and importing a named module does not carry preprocessor macros into its consumers. Keep feature macros at the implementation boundary. When a textual SDK or C header is needed, include it in the appropriate implementation or global module fragment. Compile module artifacts for each compatible configuration and distribute the installed host through the existing package contract. Clang module ABI, macro and migration guidance

What mcpp's evidence establishes​

The command in the proposal is spelled mcpp new. A developer can use that entry point without writing a Ninja file. The tagged implementation contains a Ninja backend, and its toolchain guide explains how first-run downloads and offline operation work. Capture the exact toolchain and index snapshot and pre-populate the required payloads for an offline trial. A successful second build with a warm home directory would conceal that bootstrap cost. Tagged quick start · Ninja backend · Toolchain guide

Self-hosting demonstrates that mcpp can order and rebuild a substantial modular C++ program. Upstream also names xlings and module libraries such as tinyhttps and imgui-m. Its published self-build comparison used GCC 16.1, three samples, an August mcpp version, CMake 4.4.2 and Xmake 3.1.0. The largest improvements were for touching a central interface or changing a comment. The optimized cold-build column used opt-in scheduling. These results motivate measuring identical edits on Hermes, whose graph also contains legacy headers, C, device code, generated protocols and a Web UI. Projects and benchmark · Upstream benchmark data

Two upstream implementation details make the next experiment more precise:

  • CUDA. The tagged example builds a SAXPY kernel with a selectable CPU fallback. Its authors report running it on an RTX 4080 via Clang. They also describe why they could not exercise the NVCC route on that machine. Hermes ships NVCC-built device code for multiple architectures from a runner that does not need a GPU. Reproduce that combination before assigning package readiness. CUDA example and reported hardware
  • System integration. A build.mcpp program can declare generated outputs and distinguish host pkg-config metadata from the managed payload view. This is a plausible integration route for Wayland and PyroWave. Inspect the selected .pc files, compile/link flags and installed loader path on each packaging distro. Pick an explicit packaging mode because the choice controls which runtime libraries travel with the executable. Build program · Packaging modes

What Xmake's evidence establishes​

Xmake can build directly, use Lua-based dependency and generation rules, and resolve installed libraries through pkg-config. It has module-specific scanner and builder rules. Its package manager offers a dependency lock, and XPack can emit native formats. Those features make Xmake worth evaluating if conventional system-library integration or Lua rules are the main attraction. A full port still has to represent Hermes's optional KWin protocol gate and its package-specific install decisions. Modules · System packages · Third-party providers · Dependency locking · Packaging · CUDA target options

Treat xmake project -k ninja as a separate compatibility question. In tag v3.1.2, the Ninja exporter's source-batch filter lists ordinary C/C++ and CUDA compilation, among others. The dedicated c++.build.modules rules are absent from that list. Native module support is documented. A generated Ninja build that survives a clean parallel compile and changes to imports needs its own demonstration if maintainers want that mode. Native module rules · Exporter filter · Project generator

What would change the recommendation​

Advance mcpp if it can compile the same component with a header consumer and a module consumer, reproduce the targeted invalidation and contributor benefits, and then produce one representative native package with the expected CUDA and private loader behavior. Advance Xmake if its native rules produce that result with materially less custom integration or less long-term maintenance. If CMake plus a narrow target or preset delivers the desired workflow at lower cost, retain it. A production switch would also require coverage of the remaining package matrix and a maintainer willing to own the replacement. The validation plan specifies how to reach each decision independently.