diff options
author | Martin Ashby <martin@ashbysoft.com> | 2023-08-28 19:37:50 +0100 |
---|---|---|
committer | Martin Ashby <martin@ashbysoft.com> | 2023-08-28 19:37:50 +0100 |
commit | a782c7083056558ccfe41ca42857a4680d55a9d9 (patch) | |
tree | e263263f7bfaf7da3d6fb49617226475297086c4 | |
parent | 476530136f9e5ae9ad048cfd482383819bd6d242 (diff) | |
download | zigwebserver-a782c7083056558ccfe41ca42857a4680d55a9d9.tar.gz zigwebserver-a782c7083056558ccfe41ca42857a4680d55a9d9.tar.bz2 zigwebserver-a782c7083056558ccfe41ca42857a4680d55a9d9.tar.xz zigwebserver-a782c7083056558ccfe41ca42857a4680d55a9d9.zip |
Add library output as well as executable
-rw-r--r-- | build.zig | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -16,7 +16,7 @@ pub fn build(b: *std.Build) void { const optimize = b.standardOptimizeOption(.{}); const exe = b.addExecutable(.{ - .name = "zigwebserver", + .name = "zigwebserver-exe", // In this case the main source file is merely a path, however, in more // complicated build scripts, this could be a generated file. .root_source_file = .{ .path = "src/main.zig" }, @@ -24,6 +24,14 @@ pub fn build(b: *std.Build) void { .optimize = optimize, }); + const lib = b.addStaticLibrary(.{ + .name = "zigwebserver", + .root_source_file = .{ .path = "src/zigwebserver.zig" }, + .target = target, + .optimize = optimize, + }); + b.installArtifact(lib); + // for zig module system _ = b.addModule("zigwebserver", .{ .source_file = .{ .path = "src/zigwebserver.zig" } }); |