Skip to content

Commit

Permalink
Build shared libraries again, even on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
jedisct1 committed Aug 5, 2023
1 parent 36620bf commit ea237cf
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@ pub fn build(b: *std.build.Builder) !void {
.optimize = optimize,
});

const libs = [_]*LibExeObjStep{shared, static};
const shared = b.addSharedLibrary(.{
.name = if (target.isWindows()) "sodium_shared" else "sodium",
.target = target,
.optimize = optimize,
});

const libs = [_]*LibExeObjStep{ static, shared };

const prebuilt_version_file_path = "builds/msvc/version.h";
const version_file_path = "include/sodium/version.h";
Expand All @@ -33,7 +39,7 @@ pub fn build(b: *std.build.Builder) !void {

for (libs) |lib| {
b.installArtifact(lib);
if (optimize != .Debug) {
if (optimize != .Debug and !target.isWindows() and lib != static) {
lib.strip = true;
}
lib.linkLibC();
Expand Down

0 comments on commit ea237cf

Please sign in to comment.