LinuxCommandLibrary

xmake

Cross-platform Lua-based build system

TLDR

Create new project

$ xmake create [project_name]
copy
Build project
$ xmake
copy
Build with specific mode
$ xmake -m [release]
copy
Run target
$ xmake run [target]
copy
Install package
$ xmake require [package]
copy
Clean build
$ xmake clean
copy
Configure project
$ xmake config -p [linux] -a [x86_64]
copy
Generate IDE project
$ xmake project -k [cmake]
copy

SYNOPSIS

xmake [build] [run] [clean] [require] [config] [options] [target]

DESCRIPTION

xmake is a cross-platform build system. It uses Lua for configuration, providing flexibility while remaining simple.
Build configuration in xmake.lua defines targets, dependencies, and compiler options. The syntax is more readable than CMake.
Package management is integrated. Dependencies are declared and automatically downloaded and built.
Cross-platform support covers Windows, Linux, macOS, and more. Cross-compilation and toolchain management are built-in.
Project generation creates files for CMake, Make, Ninja, Visual Studio, and Xcode. This enables integration with other tools.
Remote compilation distributes builds across machines. Cache sharing speeds up builds across teams.

PARAMETERS

build

Build project (default).
run [TARGET]
Run target.
clean
Clean build files.
config
Configure project.
require PKG
Install package.
create NAME
Create project.
project -k KIND
Generate project files.
-m MODE
Build mode (debug, release).
-p PLATFORM
Target platform.
-a ARCH
Target architecture.
-v
Verbose output.
-j N
Parallel jobs.

CAVEATS

Less widespread than CMake. Package repository smaller than vcpkg/conan. Lua config has learning curve for some.

HISTORY

xmake was created by ruki around 2015 in China. It provides a modern alternative to CMake with integrated package management and simpler syntax.

SEE ALSO

cmake(1), make(1), meson(1), ninja(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community