跳转到内容

Xmake 也支持 GO 程序的构建,也提供了空工程的创建命令支持:

sh
$ xmake create -l go -t console test
EXPLORER
src
main.go
xmake.lua
Lua xmake.lua
12345
add_rules("mode.debug", "mode.release")

target("test")
    set_kind("binary")
    add_files("src/*.go")

v2.3.6版本,xmake对其的构建支持做了一些改进,对go的交叉编译也进行了支持,例如我们可以在macOS和linux上编译windows程序:

sh
$ xmake f -p windows -a x86

更多例子见:Go Examples