环境
vscode
zig
zls
创建项目
mkdir demo; cd demo
zig init-exe
交叉编译
zig build -target xxx
zig tatgets
vscode
launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "debug",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/main",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"preLaunchTask": "debug_build",
"externalConsole": false
}
]
}
tasks.json
{
"version": "2.0.0",
"tasks": [
{
"label": "debug_build",
"type": "shell",
"command": "zig build-exe src/main.zig"
},
{
"label": "release_build",
"type": "shell",
"command": "zig build-exe src/main.zig -O ReleaseSmall"
}
]
}
标签:exe,配置,zig,开发,build,debug,main,type
From: https://www.cnblogs.com/ziyouchutuwenwu/p/16995618.html