Repository navigation
The first release.
Added
-
cx init --from: import an existing build.--from CMakeLists.txt
and/or--from vcpkg.jsondraft the cx.toml: package, standard,
find_package/FetchContent/CPM/vendored and vcpkg dependencies with their
link targets (platform- and test-only ones in their sections), defines,
flags and[[bin]]s. Nothing is evaluated; what can't be translated is
printed and listed at the end of the cx.toml.--dry-runprints it instead.
(Importing an existing project) -
Example
15-popular-libraries: fmt, spdlog and nlohmann/json from git
(spdlog built against that fmt), Catch2 as a dev-dependency, Asio from vcpkg
and Qt 6 from the system, the last two behind the featuresnetandgui. -
Example
16-migrate-cmake: a CMake project with a vendored CMake
library, next to the cx.tomlcx init --from CMakeLists.txtdrafted from
it; the end-to-end tests check that the importer still drafts it. -
The cx Book works on phones. A new style (
docs/theme/): a readable text
column, code blocks that scroll sideways instead of breaking lines, tables
that scroll on their own, and below 768px a top bar whose buttons open the
chapters and the search box as a drawer. Light and dark schemes follow the
system. -
cx docworks likecargo doc. It documents the package and every cx
package it depends on intotarget/doc/<name>/, linked to each other
through Doxygen tag files, withtarget/doc/index.htmllisting them all.
The public API (include/) by default;--document-private-itemsadds
src/.--no-deps,--features,--locked; fresh packages are not
generated again. (Formatting, linting and documentation) -
Doxygen is a managed tool:
tools.doxygen/CX_DOXYGEN, downloaded
(1.18.0) when it isn't in PATH on Linux x86-64, macOS and Windows x64, and
bycx tools install. (External tools) -
Examples, as in Cargo:
cx run --exampleandcx run --binwithout a
name list what's available;cx build --example <NAME>(repeatable) builds
just those examples. (Commands) -
package.authorsas in uv:authors = [{ name = "...", email = "..." }],
with a name, an email or both, checked when the manifest is read
("Name <email>"strings still work).cx new/cx initfill it in from git
(--author-from auto|git|none), andcx metadatareports it. (cx.toml) -
Examples of foreign dependencies:
12-cmake-dependencies(fmt and
doctest from git),13-vcpkg-dependencies(fmt and zlib from vcpkg) and
14-configure-dependencies(an Autotools project). -
examples/: eleven small cx projects, one feature each, from a
single binary to workspaces, features, CMake interop, code generation,
shared libraries, platform-specific dependencies and modules. The
end-to-end tests build and run all of them. (examples/README.md) -
Releases and
cx self update. Taggingv<version>builds cx and
cx-registry for Linux (static, x86-64 and aarch64), macOS (Intel and Apple
silicon) and Windows, and publishes them withcx-release.toml(checksums,
signed onceCX_RELEASE_SIGNING_KEYis set),SHA256SUMS, build
provenance and install scripts (install.sh,install.ps1).
cx self update [VERSION]replaces the running cx after checking the
checksum, the signature and that the new cx runs;cx self versionshows
which cx this is.cx index signalso signs a single file. A static Linux
cx finds the system's CA certificates where the distribution keeps them.
(Installation) -
Dependencies with other build systems.
{ vcpkg = true }installs a
vcpkg port (vcpkg installin manifest mode, once per set of ports and
triplet) and finds it withfind_package(). Git and path dependencies with
aconfigurescript (orconfigure.ac) or anSConstructare built at
build time and linked as<name>::<name>;build-system,libsand
include-dirssay how.cx add --vcpkg/--build-system/--lib. New tools:
tools.pythonandtools.scons(downloaded when missing),tools.vcpkg,
tools.makeandtools.autoreconf(found only). (Dependencies) -
cx cache info|gc|cleanandcx clean --gc. cx records when it uses
each cache entry (<cache>/last-use.toml);gcremoves what wasn't used
for--max-age(default 90 days) or beyond--max-size, keeping what the
project's cx.lock needs.cache.auto-gc/CX_CACHE_AUTO_GCcleans up
automatically, at most once a day. (Build caches) -
Compressed package archives.
cx packagecompresses with cx's own
deterministic deflate encoder (about as small asgzip -6); archives stay
reproducible. (Publishing) -
cx check: syntax-only compiles (-fsyntax-only, MSVC/Zs) with a
build's exact flags, incremental through depfiles, with the same
diagnostics and JSON output ascx build. (Formatting, linting and docs) -
Language-standard-aware resolution. Index entries record each version's
languageandstandard; versions that need a newer standard than the
package uses are avoided ([resolver] incompatible-standards = "fallback",
the default), refused ("deny") or ignored ("allow");max-standard
raises the limit. (Dependencies) -
Build-dependencies.
[build-dependencies]are cx packages whose
binaries[[generate]]commands run as{bin:<package>/<binary>}. They are
locked like other dependencies, never linked, and built for the host when
cross-compiling (target/host/<profile>/).cx add --build.
(Code generation and build scripts) -
A shared artifact store.
build.artifact-store(a URL or directory)
shares the artifact cache: missing compiled dependencies are downloaded
after configuring, and withbuild.artifact-store-writenew ones are
uploaded. Entries carry SHA-256 checksums of their files and can be
Ed25519-signed (build.artifact-keys,build.artifact-signing-key).
(Build caches) -
Public and private dependencies.
public = trueon a dependency makes
it part of a library's interface; others are linked privately, so users of
the library don't get their headers. A dependency withoutpublicthat the
package'sinclude/headers include stays public, with a warning to say
so.cx add --publicwrites the key.
(Dependencies) -
Platform-specific dependencies.
[target.'cfg(...)'.dependencies]
(and.dev-dependencies, or a triple instead ofcfg(...)) withunix,
windows,target_os,target_arch,target_env,target_vendor,
target_family,all,anyandnot. They are chosen for the
--targettriple or the host;cx.lockcovers every platform. Index
entries carry them astarget = "cfg(...)".cx add --platformand
cx tree --target.
(Dependencies) -
Credential providers.
[registries.<name>] credential-providerand
[registry] global-credential-providers:cx:token(credentials.toml),
cx:keychain(macOS keychain, Windows Credential Manager, Secret
Service),cx:token-from-stdout <COMMAND>, or a helper program speaking a
small stdin protocol. Providers run only when a request needs a token.
cx login/cx logoutuse the registry's first provider.
(Configuration) -
cx-registry, a small registry server installed next tocx:
init,serve(static index files with ETags, plus the publish and yank
API, with every upload checked against itscx.tomland index files signed
again) andtoken add|list|remove(stored as SHA-256 hashes, with scopes
and package globs). (Publishing) -
A registry's
apiinconfig.tomlmay be relative to the index URL. -
Managed external tools. CMake, Ninja, clang-format and clang-tidy no
longer have to be installed. cx uses the ones inPATH, and downloads a
pinned release of any that's missing (or, for CMake, older than 3.25),
checked by SHA-256, into<cache>/tools/. On Windows, Ninja isn't
downloaded automatically.tools.<name>in config.toml (orCX_CMAKE,
CX_NINJA,CX_CLANG_FORMAT,CX_CLANG_TIDY) picks"auto",
"system","managed"or a program.tools.mirror/CX_TOOLS_MIRROR
downloads from a mirror.cx tools listshows what cx runs, and
cx tools installdownloads ahead of time.
(External tools) -
cortex is a cx package. The repository's
cx.tomllets a builtcx
build and test itself (cx build,cx test). The CMake build is unchanged
and stays the way to bootstrap cx. Both builds use the same pinned
dependencies (throughcmake/deps/) and read the version fromcx.toml.
(Installation) -
CI builds cortex with the
cxit just built, on Linux and macOS. -
Agent skills in
skills/teach Claude Code to use cx: project setup,
dependencies, migrating from CMake, publishing, CI and troubleshooting.
(skills/README.md) -
The README lists cx's features.
-
Toolchains and cross-compilation.
[toolchain](cc,cxx,
min-version) and[target.<triple>](cmake-toolchain-file,sysroot,
runner,cc,cxx), incx.tomlor the configuration files. Use
--target <triple>onbuild,run,test,bench,lint,metadata
andclean; output goes totarget/<triple>/<profile>/, andrun/test
go through the runner.CC/CXXwin over both.
(Toolchains) -
Compiler caches.
build.compiler-cache(autoby default: sccache or
ccache when installed) sets the compiler launcher.CX_COMPILER_CACHE
overrides it. (Build caches) -
An artifact cache for dependencies (opt-in, with
build.artifact-cache
orCX_ARTIFACT_CACHE=1). Compiled registry and git cx packages are stored
once, keyed by a SHA-256 of their sources, features, compiler and flags, and
imported instead of rebuilt. -
cx installandcx uninstall. Install a package's binaries into
~/.local(or--root,CX_INSTALL_ROOT) from the current directory,
--path,--gitor the registry (NAME@REQ).--libalso installs the
library, its headers, its bundled cx dependencies and a CMake package
config, so plain CMake projects canfind_package()a cx library.
(Installing and CMake export) -
Code generation.
[[generate]]runs commands at build time, with
inputsandoutputs. Generated sources join the library, and generated
headers are on the include path. Abuild.cmakenext tocx.tomlis
included after the package's targets, with documentedCX_*variables.
Registry entries mark such packages withbuild-script = true, and cx
points them out once. (Code generation) -
C++20 modules.
.cppm/.ixxfiles insrc/are module units of the
library, which dependents canimport.import-std = trueturns on
import std;where CMake supports it. (C++20 modules) -
A test can span several files: each
tests/<name>/main.cppdirectory is one
test program, built from every source in it. Subdirectories without a
main.*still only hold helpers. (Package layout) -
Signed registry indexes. List a registry's trusted Ed25519 keys with
[registries.<name>] index = "..."andkeys = ["ed25519:..."]. Every index
file then needs a valid<file>.sig; a missing or bad signature is an error.
Signatures are checked before anything is parsed, cached copies included.
The index'sconfig.tomlcan list additional keys for key rotation.
(Security) -
cx index keygen,cx index signandcx index pubkeyto sign a static
registry, and--sign-keyoncx publishandcx yankto re-sign what
they change. -
cx auditcheckscx.lockagainst an advisory database: a git repository or
directory of TOML advisories, set with--db,audit.databaseor
CX_AUDIT_DB. It exits non-zero on vulnerabilities, and on informational
advisories with--deny warnings. -
cx verifydownloads every locked registry archive again, without the cache,
and checks it againstcx.lockand the index. It also checks that locked git
commits exist and locked tags haven't moved. -
cx vendor [--dir DIR]copies the sources of every locked registry and git
dependency into a directory. With[source] vendor = "vendor"(or
CX_VENDOR), builds use only those sources: no network, no cache and no
registry configuration, andcx.lockstays the same. Edited vendored files
are detected. (Vendoring) -
"dep?/feature"feature items enable a dependency's feature only if the
dependency is enabled anyway. (Features) -
"dep/KEY=VALUE"feature items set CMake options of plain CMake
dependencies. Two features setting different values for the same key are an
error. -
cx fmt [--check](clang-format),cx lint [--fix](clang-tidy, in
parallel, after a build) andcx doc [--open](Doxygen with the
doxygen-awesome-css theme). Each uses the project's.clang-format,
.clang-tidyorDoxyfilewhen there is one.
(Formatting, linting and docs) -
--message-format jsononbuild,run,test,bench,treeand
generatewrites one JSON object per line to stdout:resolved,
compiler-message,artifact,build-finishedandgenerated, each with
"format_version": 1. (Build output and JSON) -
cx metadataprints the resolved packages, their targets, and the build and
compile_commands.jsonpaths as one JSON document, for IDEs. -
Configuration keys
source.vendor,audit.databaseand
registries.<name>.keys, and environment variablesCX_VENDORand
CX_AUDIT_DB. -
New dependency: Monocypher 4.0.2, for Ed25519, pinned by SHA-256.
-
Configuration files.
~/.config/cx/config.tomlfor personal defaults and
.cx/config.tomlfor a project, with keysregistries.<name>,
net.offline,net.retries,build.jobsandterm.color. The order of
precedence is flags, then environment variables, then the project file, then
the user file. (Configuration) -
cx config get/set/unset/list;listshows where each value comes from. -
cx loginandcx logoutstore registry tokens in
~/.config/cx/credentials.toml(mode0600, refused if other users can read
it).CX_TOKENandCX_TOKEN_<NAME>also work. Tokens are only sent to the
registry's own host, and never printed. -
Failed HTTP requests (connection errors, 5xx, 429) are retried
net.retries
times (default 2). -
Profiles.
[profile.<name>]withinherits,opt-level,debug,
lto,sanitizers,defines,flagsandlink-flags, selected with
--profile. Each profile builds intotarget/<profile>/. Sanitizers and LTO
apply to every package. (Profiles) -
More targets. Binaries in
src/bin/, examples inexamples/and
benchmarks inbenches/.[[bin]],[[example]]and[[bench]]with
required-features, andpackage.default-run.
(Package layout) -
cx run --binand--example,cx build --examples/--benches/--all-targets,
andcx bench. -
[lib] kind = "shared"or"both". Every compiled library gets a generated
<name>/export.hppwith an<ID>_EXPORTmacro, and binaries find the shared
library next to themselves. -
Publishing.
cx packagebuilds a reproducible archive and checks that it
builds.cx publishpublishes into a static index directory (--index) or
through a registry's HTTP API (apiin the index'sconfig.toml).
cx yank [--undo]hides a version from new resolutions.
package.includeandpackage.excludeadjust the packaged files.
(Publishing) -
Workspaces.
[workspace]withmembers,excludeand
[workspace.dependencies](used asname = { workspace = true }), and
virtual workspaces. Members share onecx.lockand onetarget/.-pand
--workspacechoose members. (Workspaces) -
Windows and MSVC support (new, so far only tested in CI): a
CreateProcessWprocess layer, Windows paths for the cache and
configuration, and Schannel for TLS. Visual Studio's multi-config generators
are supported. -
A CI workflow: Linux with GCC and Clang, macOS, and Windows with MSVC.
-
cx new,cx init,cx build,cx run,cx test,cx clean,cx add,
cx remove,cx update,cx treeandcx generate. -
cx.tomlwith[package],[dependencies],[dev-dependencies],
[features]and[build]; the package layout is found by convention. -
Registry, git, path and system dependencies. Git and path dependencies can
be cx packages or plain CMake projects. -
Version solving with PubGrub, with readable failure reports, and
cx.lock
v2 with commits and checksums. -
Registries over HTTPS, HTTP or a local directory, with an on-disk cache,
conditional requests, parallel downloads, checksum verification and
--offline. -
Cargo-style features, including optional dependencies and dependency
features. Builds getCX_FEATURE_<PACKAGE>_<FEATURE>definitions. -
Colored, Cargo-style status output, controlled with
--color,NO_COLORand
CLICOLOR_FORCE.
Changed
-
Git dependencies are fetched shallowly. cx fetches only the commit the
tag, branch or default branch points at (--depth 1), then a locked commit
by itself if the branch has moved on: adding nlohmann/json at a tag takes
about 3 s and 10 MB instead of 90 s and 350 MB. Short revs still fetch
everything. Caches made by older versions keep working.
(Dependencies) -
cx no longer needs
tar. Registry packages, artifact-store entries,
cx package's verification, uploads tocx-registry,cx self updateand
the downloaded tools are unpacked by cx's own .tar.gz reader (ustar, pax and
GNU archives). It refuses entries and symbolic links that would point outside
the destination, andcx-registrycaps how large an upload may unpack.
(Installation) -
cx is licensed under the Apache License 2.0 instead of GPL-3.0
(LICENSE,package.license = "Apache-2.0"). -
The cx Book is built with Doxygen instead of mdBook. The
Doxyfileat
the root builds it withcx doc(target/doc/cx/), the CMakedocs
target (build/docs/html/) ordoxygen Doxyfile; CI uses the CMake
target with the Doxygen release cx pins. The chapter order moved from
SUMMARY.mdto@subpagelines inintroduction.md, and broken links
now fail the build. -
cx docwritestarget/doc/<package>/index.html(before:target/doc/index.html
for a single package, which is now the list of documented packages). -
The artifact cache's key no longer changes when CMake configures again
(CMAKE_CXX_STANDARD_LIBRARYis only set on the first configure), so
reconfiguring no longer misses the cache. The key now also covers the
compiler's target and library architecture. -
A library's dependencies are private by default (see above). Code that
used the headers of a dependency's dependency without declaring it must now
declare it, or the dependency must saypublic = true. -
cx testruns thectestnext to thecmakecx uses, not the one in
PATH. -
CMake 4.4 and newer get
-Wno-unused-cliinstead of the deprecated
--no-warn-unused-cli, which made them warn on every configure. -
The version is written only in
cx.toml. The CMake build reads it from
there and fails if[build] definespasses a differentCX_VERSION.
src/cx/version.hppis a plain header now, not generated by
configure_file. -
The unit tests are built with the same warning flags as the rest of cx.
-
Changing the compiler or toolchain file now starts the build directory's
CMake cache over. Before, CMake reset it on its own and lost the other
configure settings. -
Public include directories in the generated CMake are wrapped in
$<BUILD_INTERFACE:...>, so exported targets are relocatable. -
On a terminal, builds show a progress bar instead of the build tool's raw
output. Diagnostics still appear as they arrive, and warnings are summarized
per package at the end. Output is unchanged with--verbose, with
--quiet, when stderr isn't a terminal, or withTERM=dumb. -
--lockednow fails with a clear message when a locked package would come
from a different source (dependency confusion), instead of only reporting
thatcx.lockneeds to change. -
With several binaries,
cx runneeds--binorpackage.default-run, and
says so. -
Registries can be configured in the configuration files as well as with
CX_REGISTRY/CX_REGISTRY_<NAME>. The environment variables still win. -
Every compiled library now gets a generated export header. Static libraries
define<ID>_STATIC_DEFINE.
Fixed
- Tests, examples and benches of a shared library on Windows find its
.dll:cx testputstarget/<profile>/first in the tests'PATH, and
examples and benches get a copy of the DLL in their directory. Before, they
couldn't start, and Windows waited on an error dialog, socx testhung. cx now also starts
programs with Windows' error dialogs off, so a missing DLL or a crash fails
right away. (Package layout) - C++20 modules with a compiler CMake can't scan (AppleClang, or Clang
withoutclang-scan-deps) now fail at configure with a message saying
what to install, instead of with CMake's error or...-NOTFOUND: not found
in the middle of the build. (C++20 modules) --message-format jsonpaths on Windows:compiler-messagefile
values from MSVC use/like every other path cx reports, instead of
MSVC's\. (Build output and JSON)cx newno longer takes git's guessed identity as the author. Without
user.name/user.email(orGIT_AUTHOR_NAME/GIT_AUTHOR_EMAIL), git
makes one up from the login and host name (runner@Mac-1234.localon
macOS);--author-from autonow leavesauthorsout andgitfails.
(Getting started)- macOS build:
process_posix.cppcallssigemptysetand friends
unqualified (macOS defines them as macros), and creates pipes without
pipe2(), which macOS lacks:pipe()plusFD_CLOEXEC, under a lock shared
with spawning so no child inherits a half-made pipe. The deprecation of
posix_spawn_file_actions_addchdir_npin macOS 26 no longer warns. - MSVC build: headers and sources include every standard header they use
(version_set.hppusedstd::optionalwithout<optional>, which only
GCC's and Clang's libraries happened to provide). - MSVC build: file times go through
fs::unix_seconds, because MSVC's
file_clockhasto_utc()but noto_sys()(cx cacheandcx clean --gc
didn't compile on Windows). Theto_utc()path is only compiled where the
library hasutc_clock, which libc++ (macOS) doesn't. - The Linux Clang CI job builds with
clang-20from Ubuntu's archive.
With Clang 18, the runner's default, libstdc++ declares nostd::expected,
and nothing compiled. Configuring with such a compiler now stops with an
error that says which compilers work. Building cx needs Clang 19 or newer
(Clang 18 only with libc++).