CLI tool
xmake-io/xmake avatar
xmake-io/xmake

xmake Deep Analysis: Inside the xmake.lua Grammar and the Gaps Around It

Project brief: A cross-platform build utility based on Lua. Xmake is a cross-platform build utility based on the Lua scripting language.

12,302 stars965 forksLuaApache-2.0

At a glance

What is it?
Xmake puts a build backend, project generators, a package manager, remote and distributed builds, and a cache behind a single xmake.lua file. This walkthrough covers the xmake.lua grammar and the command reference from the project README.
Who is it for?
Choose xmake if you want one Lua file to carry your build definition, your package requirements and your platform selection, and you are willing to read the guide on xmake.io for details beyond the README. Leave it if a reproducible dependency set or an in-repository record of the target platform is a hard requirement, because the README does not show a way to freeze the dependency set.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository received new commits within the last day.
What is it written in?
Mainly Lua, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 14, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • xmake-io/xmake12,302 ★ · +187
Star history
Repository2026-07-302026-11-14
xmake-io/xmake12.1k12.3k

187 Stars in the last 107 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

The xmake.lua target block is the whole project description

A minimal xmake project is three calls.

lua
target("console")
    set_kind("binary")
    add_files("src/*.c")

The first line opens a named target, the second says to produce a linkable executable rather than a library, and the third pulls in every source file ending in .c under src. Dependencies go into the same file:

lua
add_requires("tbox 1.6.*", "zlib", "libpng ~1.6")

Those version suffixes are constraints rather than pins. The first asks for any 1.6 release of tbox, the bare zlib asks for any version at all, and the tilde form holds libpng to the 1.6 series. Keeping the build definition, the dependency requests and the file globbing in one short script is the reason a project can switch between a direct build and a generated project without rewriting anything.

Platform, architecture and optimization live in the xmake f flags

A build is aimed at a target with three flags on a configure step, followed by a plain build:

bash
$ xmake f -p [windows|linux|macosx|android|iphoneos ..] -a [x86|arm64 ..] -m [debug|release]
$ xmake

Platform, architecture and optimization level are command line inputs, so the project file itself stays identical no matter which of them you pick. The interactive path reaches the same three settings through a picker:

bash
$ xmake f --menu

The three install commands pipe a remote text file into your shell

Installation is three one-liners, one per shell convention. On a Unix-like shell:

bash
curl -fsSL https://xmake.io/shget.text | bash

The wget equivalent:

bash
wget https://xmake.io/shget.text -O - | bash

And the PowerShell form:

sh
irm https://xmake.io/psget.text | iex

Each downloads a text file from xmake.io and hands it straight to the interpreter. No checksum, no version argument, no list of the files it writes, and no mirror are given. The exposure is the obvious one, since the code you execute is whatever that address returns at the moment you run it, and there is no documented way to pin a release or verify a signature. If your network blocks those hosts, all three commands fail, and the only alternative named is a link to the installation guide for building from source and for package managers. The code you would build yourself is Apache-2.0 licensed, and the checkout also carries a `configure` entry at the top level.

xmake show -l toolchains names twelve front ends and no way to choose one

The toolchain list is one command:

bash
$ xmake show -l toolchains

Its output names xcode for the Apple toolchain, msvc, clang-cl described as an LLVM Clang compiler compatible with msvc, clang, yasm, go, the D compilers dlang, dmd, ldc and gdc, the Fortran pair gfortran and flang, and zig. The toolchain list is wider than C and C++, which matters because the feature list claims support for mixed-language projects. A target mixing C with Go, D or Fortran needs more than one compiler.

Generating CMake or Meson files creates a second source of truth

Xmake works in either direction. It can act as a build backend and compile source directly, the way Make or Ninja do, or act as a project generator and emit CMake, Meson, Visual Studio, Makefiles or compile_commands.json for editors and IDEs. The page draws the whole surface as a build backend plus a project generator plus a package manager plus remote or distributed build plus a cache, and gives the rougher comparison as Make and Ninja plus CMake and Meson plus Vcpkg and Conan plus distcc plus ccache and sccache in one tool. Both directions are driven by the same xmake.lua, which is the appeal.

The supported platform list runs well past what the build badges cover

The platform list names Windows, macOS, Linux, FreeBSD, NetBSD, OpenBSD, DragonflyBSD, Solaris, Android, iOS, WatchOS, AppleTVOS, AppleXROS, MSYS, MinGW, Cygwin, Wasm, Haiku and Harmony, each with its architecture variants, plus a final entry for arbitrary cross toolchains. The architectures reach as far as riscv, mips, 390x and sh4 on Linux, arm64ec on Windows and armv7k on WatchOS. Two consequences follow for anyone selecting a target. First, a listed platform says what the tool accepts as a target, while the continuous integration links on the page point only at Windows, Linux and macOS workflows, so the remaining entries have no visible verification path. Second, the awkward ones, 390x, sh4, AppleXROS and the Harmony entries, are hard to confirm from the outside, which means a failure there is yours to diagnose.

Package definitions live outside the repository in xmake-repo

add_requires names a package, but the definition behind that name is not in this repository. The official package repository sits at xmake-io/xmake-repo, with a stated constraint of tbox greater than 1.6.1, and an official package manager fetches and installs whatever the requirements ask for. The version text in xmake.lua is therefore a request handed to a resolver, not a statement about what ends up on disk, and that distinction is what decides whether a build reproduces. Two checkouts of the same commit can resolve differently as packages are added or version constraints move, and a reader who reads 1.6.* as a promise will meet the first later 1.6 release without warning. A second repository is also where a failure gets diagnosed least easily, since a build that breaks because a package definition changed upstream looks identical to a build that broke because your own file changed.

Editorial conclusion

Choose xmake if you want one Lua file to carry your build definition, your package requirements and your platform selection, and you are willing to read the guide on xmake.io for details beyond the README. Leave it if a reproducible dependency set or an in-repository record of the target platform is a hard requirement, because the README does not show a way to freeze the dependency set. Before committing, check the install path you will actually use, since all three scripts execute a remote text file with no documented checksum and no version argument. The last push is dated 2026-11-01 on the default branch dev, with v3.1.2 released on 2026-10-16, v3.1.1 on 2026-08-27 and v3.1.0 on 2026-08-08.

Frequently asked questions

what is xmake

A cross-platform build utility based on the Lua scripting language, described as lightweight with no dependencies outside of the standard library. Project builds are maintained in an xmake.lua file, and it carries a built-in package management system for C/C++ dependencies.

What are the key differences between Xmake and CMake?

Xmake compiles source directly, the way Make or Ninja do, and can also generate project files like CMake or Meson. The page places it as Make and Ninja plus CMake and Meson plus Vcpkg and Conan plus distcc plus ccache and sccache combined in a single tool, with its own package manager attached.

How do I install XMake on Windows?

PowerShell runs one line: irm https://xmake.io/psget.text | iex. For anything else, including building from source and using package managers, the page points to the installation guide on xmake.io.

xmake vs ninja

The page places xmake over that ground rather than against it, writing the comparison as Make and Ninja plus CMake and Meson plus Vcpkg and Conan plus distcc plus ccache and sccache. On top of the build backend it lists project generators, a built-in package manager, remote and distributed compilation, and local and remote build cache.

xmake vs vscode

Nothing on the project page is specific to any editor. The closest item is compile_commands.json, listed among the project generators xmake can emit alongside Visual Studio, Makefiles and CMake.

Official sources

  1. Official documentation
  2. Official README
  3. Project repository
  4. Release notes
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/xmake-io-xmake.svg)](https://hysenlabs.com/projects/xmake-io-xmake)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/xmake-io-xmake.svg)](https://hysenlabs.com/projects/xmake-io-xmake)

Was this useful?