Skip to content
Latchkey

xmake: Lua-Based Build and Package Tool

xmake builds a project described in xmake.lua; running bare xmake configures and builds in one step, with dependencies resolved by its package manager.

xmake is a self-contained build tool for C/C++ that bundles configuration, building, and package management. In CI, xmake config sets the mode and xmake (or xmake build) compiles.

What it does

xmake reads xmake.lua, and on a bare xmake it auto-configures if needed then builds. xmake config sets persistent options like the build mode; xmake build builds specific targets. Its package manager can fetch and build dependencies declared with add_requires.

Common usage

Terminal
xmake config -m release
xmake            # configure (if needed) and build
xmake build mytarget
xmake -j8        # build with 8 jobs

Options

Command / flagWhat it does
xmake config -m <mode>Set build mode: debug or release
xmake build [target]Build the project or a named target
xmakeConfigure if needed, then build the default target
-j <N>Parallel job count
xmake install -o <dir>Install artifacts to an output directory
-yAuto-confirm prompts (e.g. package downloads)

In CI

Run xmake config -m release then xmake -j$(nproc). Pass -y so package-download prompts do not hang a non-interactive job. Cache the xmake package cache directory (~/.xmake) between runs to avoid re-downloading and rebuilding dependencies.

Common errors in CI

"error: xmake.lua not found!" means you are not in the project root. "error: package(foo) not found!" means a required package could not be resolved; check the repository or network. A build that hangs waiting for input usually needs -y to auto-confirm a download. "error: unknown target(foo)" means a typo in the target name.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →