Skip to content

Commit

Permalink
Update for zig-master
Browse files Browse the repository at this point in the history
  • Loading branch information
jedisct1 committed Jan 4, 2024
1 parent d4444ad commit 641926a
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions build.zig
Original file line number Diff line number Diff line change
@@ -1,25 +1,21 @@
const std = @import("std");
const builtin = @import("builtin");

pub fn build(b: *std.build.Builder) !void {
pub fn build(b: *std.Build) !void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{ .preferred_optimize_mode = .ReleaseSmall });

const dsvpn = b.addExecutable(.{
.name = "dsvpn",
.target = target,
.optimize = optimize,
.strip = true,
});
dsvpn.linkLibC();
dsvpn.strip = true;
dsvpn.addIncludePath(.{ .path = "include" });
dsvpn.defineCMacro("_GNU_SOURCE", "1");
const source_files = &.{ "src/charm.c", "src/os.c", "src/vpn.c" };
if (@hasDecl(std.Build.Step.Compile, "AddCSourceFilesOptions")) {
dsvpn.addCSourceFiles(.{ .files = source_files });
} else {
dsvpn.addCSourceFiles(source_files, &.{});
}
dsvpn.addCSourceFiles(.{ .files = source_files });
b.installArtifact(dsvpn);
const run_cmd = b.addRunArtifact(dsvpn);
run_cmd.step.dependOn(b.getInstallStep());
Expand Down

0 comments on commit 641926a

Please sign in to comment.