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

Xmake: A Lua-Based Build Tool That Folds Package Management and Cross-Compilation into One Binary

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

12,217 stars952 forksLuaApache-2.0

At a glance

What is it?
Xmake is a cross-platform build utility that uses Lua for project configuration, combining a build backend, project generator, and package manager. This review covers its mechanism, installation, limitations, and who should adopt it.
Who is it for?
Adopt Xmake if you need a single tool that handles building, dependency fetching, and cross-compilation for C/C++ and several other languages, especially if you value a Lua-based configuration that is more readable than CMake's. Avoid it if you require a mature ecosystem with extensive third-party documentation, or if your team is already deeply invested in CMake or Meson and has no need for a package manager.
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 last received commits 1 day ago.
What is it written in?
Mainly Lua, according to GitHub's language statistics.

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

DEEP OPEN-SOURCE ANALYSIS

What Xmake Solves and Who It Is For

Xmake aims to replace the typical multi-tool stack for C/C++ projects: a build backend like Make or Ninja, a project generator like CMake or Meson, and a package manager like Vcpkg or Conan. The README explicitly frames it as 'Xmake = Build backend + Project Generator + Package Manager + [Remote|Distributed] Build + Cache'. It targets developers who want one tool that can build source directly, generate IDE project files, and fetch dependencies, all with a simple Lua-based configuration. The intended user is someone comfortable with scripting and who wants to avoid the syntax complexity of CMake. It is also for teams that need to cross-compile for a wide range of platforms, from Windows and macOS to Android, iOS, and even embedded targets like Haiku and Harmony.

The Lua Configuration Model and Its Mechanism

The core of Xmake is the xmake.lua file, which uses Lua to describe targets and dependencies. A minimal project is just a few lines: a target of kind 'binary' and a list of source files. The configuration is executed as a Lua script, which means users can use loops, conditionals, and functions to generate build rules, unlike CMake's domain-specific language. The README gives an example: target('console') set_kind('binary') add_files('src/*.c'). This is a declarative description, but because it is Lua, it is also programmatic. Xmake then acts as the build backend, invoking the appropriate toolchain and handling parallel compilation. It also supports incremental builds with automatic header file analysis, which is a feature that many build tools claim but few implement as cleanly.

Getting Xmake Running: Installation and Basic Commands

Installation is designed to be dependency-free. The README provides one-liner scripts for Unix-like systems using curl or wget, and a PowerShell command for Windows. After installation, the workflow is straightforward. From a project root with an xmake.lua, you run 'xmake' to build, 'xmake run console' to execute a target, and 'xmake test' to run tests. Configuration is done with 'xmake f -p [platform] -a [architecture] -m [mode]', where platform can be windows, linux, macosx, android, or iphoneos, among others. There is also an interactive menu configuration via 'xmake f --menu', which is a nice touch for those who prefer a TUI over command-line flags. The package management is equally simple: in the xmake.lua you add 'add_requires("tbox 1.6.*", "zlib", "libpng ~1.6")' and Xmake fetches and builds those dependencies automatically.

Cross-Compilation and Platform Coverage

Xmake's platform list is extensive: Windows, macOS, Linux, BSD variants, Solaris, Android, iOS, WatchOS, AppleTVOS, AppleXROS, MSYS, MinGW, Cygwin, Wasm, Haiku, Harmony, and a generic 'Cross' option for custom toolchains. This breadth is unusual for a single build tool. The README claims 'intelligent analysis of cross toolchain information', which suggests that Xmake can inspect the toolchain and set appropriate flags automatically. However, the documentation does not specify how this analysis works, so users may need to manually specify toolchain paths for exotic targets. The toolchain list includes not just C/C++ compilers but also Go, D, Fortran, Zig, Rust, and others, indicating that Xmake is not limited to C/C++. This makes it a potential choice for mixed-language projects, though the depth of support for each language is not detailed in the README.

Limitations and Cases Where Xmake Is the Wrong Tool

The most obvious limitation is that Xmake is less mature and less widely adopted than CMake or Meson. While the README lists many features, it does not provide a detailed comparison or migration guide for existing CMake projects. If your project relies on a large, established CMake ecosystem with custom modules and toolchain files, moving to Xmake would require rewriting the build configuration. Also, the package manager depends on the official xmake-repo, which may not have every library or version you need. The README mentions 'tbox >1.6.1' as an example, but for less common packages, you might have to write your own package recipes, which is a non-trivial task. Another limitation is the lack of a Windows-native installer script; the PowerShell command is provided, but it may not support all corporate environments. Finally, the documentation is still developing, and some features like distributed compilation and remote build are listed but not explained in the README, so expect to dig into the official docs for details.

Alternatives: CMake and Meson

The primary alternative is CMake, which is the de facto standard for C/C++ build systems. CMake uses its own scripting language and has a vast ecosystem of modules and toolchain files. Unlike Xmake, CMake does not have a built-in package manager; you typically pair it with vcpkg or Conan. Meson is another alternative, written in Python, that uses a simpler, declarative syntax and has built-in support for many languages. Meson also integrates with Ninja as its backend and has a package manager called Wrap. The key difference is that Xmake's configuration is Lua, which is a general-purpose language, whereas CMake and Meson use domain-specific languages. This gives Xmake more flexibility for complex build logic, but it also means that the learning curve is different. If you already know Lua, Xmake will feel natural; if you know Python, Meson might be easier. If you need the largest ecosystem and community support, CMake is safer.

Maintenance and Upgrade Cost

Xmake is actively maintained, with recent releases in 2026, including v3.1.1. The project is licensed under Apache-2.0, which is permissive and allows commercial use without copyleft obligations. The upgrade cost is moderate: because the configuration is Lua, breaking changes in the API can affect your xmake.lua files, but the project seems to keep a stable core. The README mentions a large number of expansion modules and plug-in support, which means you can extend Xmake, but you must keep those modules updated. There is no explicit statement about backward compatibility, so it is wise to pin your Xmake version for production builds. The installation scripts are simple, but they pull the latest version, so you may want to use a package manager to lock a specific version. Overall, the maintenance burden is lower than that of a custom Makefile system, but higher than using a system package manager for build tools.

Editorial conclusion

Adopt Xmake if you need a single tool that handles building, dependency fetching, and cross-compilation for C/C++ and several other languages, especially if you value a Lua-based configuration that is more readable than CMake's. Avoid it if you require a mature ecosystem with extensive third-party documentation, or if your team is already deeply invested in CMake or Meson and has no need for a package manager. Before adopting, verify that your specific toolchains and platforms are listed in the supported set, and test the package dependency resolution for your exact library versions, as the official xmake-repo may not cover every package or version you need.

Official sources

  1. Official documentation
  2. Official README
  3. Project repository
  4. Release notes
Community notes

Community notes