explaingit

xmake-io/xmake

11,974LuaAudience · developerComplexity · 3/5Setup · easy

TLDR

Xmake is a cross-platform build tool for C, C++, and many other languages that combines compilation, dependency management, project file generation, and build caching into one command-line tool with no external dependencies.

Mindmap

mindmap
  root((xmake))
    What it does
      Compiles code
      Manages packages
      Generates project files
      Caches builds
    Config
      xmake.lua
      Lua scripting
    Supported Languages
      C and C++
      Rust Swift Zig Go
      WebAssembly
    Platforms
      Windows macOS Linux
      Android iOS
      Embedded cross-compile
    Toolchains
      GCC Clang MSVC
      Community support
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Build and compile a C or C++ project on Windows, macOS, or Linux with a single xmake command and a short xmake.lua config file.

USE CASE 2

Add and automatically download third-party dependencies by declaring them in a few lines, without manual linking.

USE CASE 3

Cross-compile code for Android, iOS, or WebAssembly targets without setting up separate toolchain configuration.

USE CASE 4

Generate project files for other IDEs from the same build config, so teammates can open the project in their preferred editor.

Tech stack

LuaCC++GCCClangMSVCZigWebAssembly

Getting it running

Difficulty · easy Time to first run · 5min

In plain English

Xmake is a build tool for C and C++ projects (and many other languages) that runs on Windows, macOS, Linux, Android, iOS, and a wide range of other platforms. A build tool automates the process of compiling source code files into a working program. Xmake fills a role similar to Make, CMake, and Ninja, but tries to combine several functions into one tool: compiling code, managing dependencies, generating project files for other tools, and caching build results to speed up repeated builds. Project configuration is written in a file called xmake.lua using Lua, a lightweight scripting language. The README shows how simple this can be: a few lines declare what kind of output you want (such as a runnable program) and which source files to include. Dependency packages can be added in a similar short declaration, and xmake will download and link them automatically from its official package repository. The tool has no external dependencies beyond the standard library, which means installation is straightforward. You can install it with a single curl or wget command on macOS and Linux, or via PowerShell on Windows. Once installed, common tasks are done from the command line: xmake to build, xmake run to run the output, xmake test to run tests, and xmake f to configure the target platform and architecture before building. Xmake supports a large number of compilers and toolchains: GCC, Clang, MSVC, Rust, Swift, Zig, Go, Fortran, and many more. On the platform side, it covers everything from desktop operating systems to Android, iOS, WebAssembly, and embedded cross-compilation targets. The project describes itself as combining what would otherwise require separate tools: a build backend, a project file generator, a package manager, and a distributed or remote build system with caching. Community support is available via Discord, Telegram, Reddit, and QQ.

Copy-paste prompts

Prompt 1
I have a C++ project and want to use xmake instead of CMake. Write me a minimal xmake.lua that builds an executable from src/*.cpp and links a dependency fetched from the xmake package repository.
Prompt 2
How do I configure xmake to cross-compile my C project for Android ARM64 on a Linux host? Show the xmake f command and any xmake.lua changes needed.
Prompt 3
Show me how to write xmake.lua for a project that has both a static library and an executable that depends on it, using xmake's built-in build system.
Prompt 4
How do I register and run unit tests with xmake test? What do I add to xmake.lua to define a test target?
Prompt 5
I want to speed up CI builds using xmake's remote build cache. What configuration do I add to xmake.lua to enable distributed caching?
Open on GitHub → Explain another repo

← xmake-io on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.