Enable build artifact.

frunk
Lonnie 2021-08-01 20:43:38 +02:00
parent add4067e74
commit 3460022693
2 changed files with 12 additions and 1 deletions

View File

@ -6,6 +6,8 @@ packages:
- curl-dev
environment:
version: zig-linux-x86_64-0.9.0-dev.689+507dc1f2e
artifacts:
- derploader/zig-out/bin/derploader
tasks:
- getzig: |
wget https://ziglang.org/builds/${version}.tar.xz
@ -25,7 +27,8 @@ tasks:
- build: |
cd derploader
source source-me.sh
$zig build
$zig build -Drelease-small=true -Dtarget=x86_64-linux-gnu -Dcpu=sandybridge -Dstrip=true -Dstatic=true
strip -s zig-out/bin/derploader
triggers:
- action: email
condition: failure

View File

@ -18,8 +18,16 @@ pub fn build(b: *std.build.Builder) void {
// Standard release options allow the person running `zig build` to select
// between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall.
const mode = b.standardReleaseOptions();
const strip = b.option(bool, "strip", "strip executable");
const static = b.option(bool, "static", "compile a static executable");
const exe = b.addExecutable("derploader", "src/main.zig");
if (strip != null) {
exe.strip = strip.?;
}
if (static != null and static.? == true) {
exe.linkage = .static;
}
deps.addAllTo(exe);
exe.linkLibC();
exe.linkSystemLibrary("libcurl");