gitmyhub

xmake

Lua ★ 12k updated 8h ago

🔥 A cross-platform build utility based on Lua

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.

LuaCC++GCCClangMSVCZigWebAssemblysetup: easycomplexity 3/5

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.

Where it fits