← 返回命令列表

Linux command

xmake 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Create new project

xmake create [project_name]

Build project

xmake

Build with specific mode

xmake -m [release]

Run target

xmake run [target]

Install package

xmake require [package]

Clean build

xmake clean

Configure project

xmake config -p [linux] -a [x86_64]

Generate IDE project

xmake project -k [cmake]

说明

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.

参数

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.

FAQ

What is the xmake command used for?

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.

How do I run a basic xmake example?

Run `xmake create [project_name]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does build do in xmake?

Build project (default).