
Xmake
Lua-configured C/C++ build system with built-in package manager.
Replaces —
Who it's for
Xmake produces a much shorter configuration file for the same build graph as a typical CMake project. Package management is built in, so there is no separate vcpkg or Conan integration to set up. The generator plugin produces CMake output when interoperability with external consumers is needed.
If your project already uses CMake and integrates deeply with CMake-native tools (CPack, CTest, CDash), the migration cost may outweigh the syntax improvement. Xmake is a stronger fit for greenfield projects.
Xmake supports over 40 toolchains including Android NDK, ARM Keil MDK, RISC-V, and musl-based cross-compilation. The `xmake f` command sets platform, architecture, and build mode in one step. Toolchain packages pull automatically via `add_requires`, eliminating manual path configuration.
Teams targeting a single well-supported platform (Linux x86_64 only, for example) will not see as much benefit from Xmake's cross-platform machinery compared with a simpler Makefile or Meson setup.
Xmake's distributed compilation requires no additional infrastructure beyond the machines already running build agents. lz4-compressed file transfer and load balancing ship with the CLI. Local and remote build caches share the same warming step.
Teams with existing distributed build infrastructure (Incredibuild, DistCC) that already meets build time targets may not need to migrate their build system to gain the distributed compilation benefit.
The problem
C/C++ projects commonly need three or four separate tools to get a build working: CMake or Meson for project configuration, Ninja or Make for the actual build, vcpkg or Conan for dependency management, and ccache or sccache for caching. Each tool has its own configuration format, its own quirks, and its own failure modes. CMake in particular uses a macro language that becomes hard to read at scale and varies widely in style across projects. Cross-compilation adds more difficulty. Configuring toolchain files for Android NDK, ARM embedded targets, or RISC-V typically means writing additional CMake files or build scripts that need to be maintained separately from the main build. Teams working across Windows, macOS, and Linux frequently maintain slightly different build instructions for each platform.
How it works
Projects are configured in an `xmake.lua` file using Lua scripting. A minimal binary target is three lines: target name, kind, and source file pattern. Dependency declarations use the same file: `add_requires` fetches, caches, and links a library with version pinning. No macro language, no separate toolchain configuration files for common targets.
The official xmake-repo ships nearly 500 packages with pre-compiled caches on Windows. Third-party repositories plug in via the same `add_requires` syntax: Conan, vcpkg, Homebrew, apt, conda, and cargo packages all resolve through one interface. Private repositories are supported for internal package hosting.
Benchmarks from the xmake-core project show parallel build times of 24.9 seconds on an 8-core ARM device, versus 25.7 seconds for Ninja on the same workload. Incremental builds cache at the header-file level, so unchanged translation units are skipped automatically.
Distributed builds spread compilation across multiple machines using MSVC, Clang, or GCC without shared filesystems. Files transfer compressed with lz4, and build server load balancing is built in. Remote compilation lets a local machine delegate to a more powerful build server, useful for cross-compilation on underpowered hardware.
Supported toolchains include MSVC, Clang, GCC, Rust, Go, Swift, Zig, Nim, CUDA, Android NDK, and ARM compilers. Beyond C and C++, Xmake builds Objective-C, Swift, Rust, Go, D, Fortran, Zig, Vala, Pascal, and CUDA targets in mixed-language projects from the same configuration file.
Plugin commands generate project files for Visual Studio (vs2002 through vs2026), CMake, Ninja, and compile_commands.json for IDE integration with clangd and other language servers. One build definition covers local development in any IDE, CI pipelines, and terminal builds.
Features
- Lua configuration with minimal syntax
- Built-in package manager with 500+ packages
- Parallel compilation on par with Ninja
- Distributed and remote compilation
- 40+ toolchains and 20+ target languages
- IDE and build system generators
How to install
Install Xmake on Linux and macOS using the official setup script.
curl -fsSL https://xmake.io/shget.text | bashOn Windows, install with the official PowerShell setup script.
irm https://xmake.io/psget.text | iexRecommended for this setup
Strengths
- Apache-2.0 license with no usage fees: Xmake is Apache-2.0 licensed, which means no licensing fees at any usage level, including commercial projects and internal CI infrastructure. Unlike commercial build acceleration tools that charge per-user or per-core, Xmake's distributed compilation is available to teams of any size at no cost.
- Lightweight and dependency-free install: Xmake installs from a single shell script and has no external library dependencies beyond the standard library. On CI runners, installation takes seconds. There is no daemon to manage and no database to migrate. The binary is self-contained and runs immediately after install.
- Single CLI replaces multiple build utilities: The README describes Xmake as equivalent to Make/Ninja + CMake/Meson + vcpkg/Conan + distcc + ccache/sccache in one CLI. Using one tool instead of four means fewer version conflicts, one place to look when builds break, and one configuration format to learn across platforms.
Trade-offs
- Lua learning curve for new contributors: xmake.lua files require Lua scripting knowledge, which is less common than CMake's declarative style. Teams onboarding developers unfamiliar with Lua will face a ramp-up period, and scripting errors in build files produce Lua stack traces rather than descriptive error messages at the build-system level.
- Smaller ecosystem than CMake: CMake has decades of community-maintained modules, FindXXX files, and documentation. Projects with CMake-only integrations (some large frameworks, game engines, or toolkits) require extra work to build with Xmake, and community answers to specific Xmake questions are less common on Stack Overflow.
- 256 open issues in the GitHub tracker: The repository had 256 open issues when this listing was written. For a tool that controls an entire project build, open issues in edge-case platforms or toolchain combinations are worth reviewing before adopting Xmake for a production CI pipeline.
Tech stack
FAQ
Yes. Xmake is Apache-2.0 licensed, which permits commercial use, modification, and distribution without restriction. There is no paid tier, no per-core licensing, and no usage cap. All features, including distributed compilation and the full package manager, are included.
CMake uses a macro language that grows verbose as project complexity increases. Xmake uses Lua, which is a real scripting language with functions, loops, and conditionals. A minimal Xmake target takes three lines; the equivalent CMake target typically takes more. Xmake also bundles package management, removing the need for a separate vcpkg or Conan integration. The tradeoff is that CMake has a much larger community, more upstream project support, and more documentation available.
Yes. Xmake builds with MSVC on Windows and can generate Visual Studio project files for vs2002 through vs2026 using the `xmake project -k vsxmake` command. Pre-compiled package caches are available for Windows, which speeds up dependency installation compared to building packages from source.
Yes. Xmake integrates with vcpkg, Conan, Homebrew, conda, apt, and other package ecosystems through the `add_requires` syntax. A vcpkg package is declared as `add_requires("vcpkg::<name>")` and a Conan package as `add_requires("conan::<name>/<version>")`. The official xmake-repo with 500+ packages covers the most common C/C++ dependencies.
On Windows, install Xmake using PowerShell: run `irm https://xmake.io/psget.text | iex` in a PowerShell window. The installer adds Xmake to your PATH. The official installation guide at xmake.io also covers Winget, Scoop, and Chocolatey as alternative package manager options.