+ +

安装

+ +

使用curl

+ +
bash <(curl -fsSL https://raw.githubusercontent.com/tboox/xmake/master/scripts/get.sh)
+
+
+ +

使用wget

+ +
bash <(wget https://raw.githubusercontent.com/tboox/xmake/master/scripts/get.sh -O -)
+
+
+ +

使用powershell

+ +
Invoke-Expression (Invoke-Webrequest 'https://raw.githubusercontent.com/tboox/xmake/master/scripts/get.ps1' -UseBasicParsing).Content
+
+
+ +

简单的工程描述

+ +
target("console")
+    set_kind("binary")
+    add_files("src/*.c") 
+
+
+ +

构建工程

+ +
$ xmake
+
+
+ +

运行目标

+ +
$ xmake run console
+
+
+ +

调试程序

+ +
$ xmake run -d console
+
+
+ +

支持特性

+ + + +

支持平台

+ + + +

支持语言

+ + + +

内置插件

+ + + +

更多插件

+ +

请到插件仓库进行下载安装: xmake-plugins.

+ +

更多例子

+ +

Debug和Release模式:

+ +
if is_mode("debug") then
+    set_symbols("debug")
+    set_optimize("none")
+end
+
+if is_mode("release") then
+    set_symbols("hidden")
+    set_optimize("fastest")
+    set_strip("all")
+end
+
+target("console")
+    set_kind("binary")
+    add_files("src/*.c") 
+
+
+ +

自定义脚本:

+ +
target("test")
+    set_kind("static")
+    add_files("src/*.cpp")
+    after_build(function (target)
+        print("build %s ok!", target:targetfile())
+    end)
+
+
+ +

使用扩展模块:

+ +
target("test")
+    set_kind("shared")
+    add_files("src/*.c")
+    on_load(function (target)
+        import("lib.detect.find_package")
+        target:add(find_package("zlib"))
+    end)
+
+
+ +

项目例子

+ +

一些使用xmake的项目:

+ + + +

演示视频

+ +

asciicast

+ +

联系方式

+ + + + + + + + +