Skip to content

Commit 5d7c228

Browse files
committed
Update build.zig to 0.14.0/0.15.1 compat
closes #9
1 parent 391fb55 commit 5d7c228

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Welcome to the OpenSSL Project (Forked to zig-pkg support [v0.14.0])
1+
Welcome to the OpenSSL Project (Forked to zig-pkg support [v0.14.0 <-> 1.15.1 compat])
22
==============================
33

44
[![openssl logo]][www.openssl.org]

build.zig

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,12 @@ pub fn build(b: *std.Build) void {
1616
}
1717

1818
fn libcrypto(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.builtin.OptimizeMode) *std.Build.Step.Compile {
19-
const lib = b.addStaticLibrary(.{
19+
const lib = b.addLibrary(.{
2020
.name = "crypto",
21-
.target = target,
22-
.optimize = optimize,
21+
.root_module = b.createModule(.{
22+
.target = target,
23+
.optimize = optimize,
24+
}),
2325
});
2426
lib.pie = true;
2527
switch (optimize) {
@@ -893,10 +895,12 @@ fn libcrypto(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.buil
893895
}
894896

895897
fn libssl(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.builtin.OptimizeMode) *std.Build.Step.Compile {
896-
const lib = b.addStaticLibrary(.{
898+
const lib = b.addLibrary(.{
897899
.name = "ssl",
898-
.target = target,
899-
.optimize = optimize,
900+
.root_module = b.createModule(.{
901+
.target = target,
902+
.optimize = optimize,
903+
}),
900904
});
901905
lib.pie = true;
902906
switch (optimize) {
@@ -1006,10 +1010,12 @@ fn libssl(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.builtin
10061010
}
10071011

10081012
fn libprovider(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.builtin.OptimizeMode) *std.Build.Step.Compile {
1009-
const lib = b.addStaticLibrary(.{
1013+
const lib = b.addLibrary(.{
10101014
.name = "providers",
1011-
.target = target,
1012-
.optimize = optimize,
1015+
.root_module = b.createModule(.{
1016+
.target = target,
1017+
.optimize = optimize,
1018+
}),
10131019
});
10141020
lib.root_module.addIncludePath(b.path("include"));
10151021
lib.root_module.addIncludePath(b.path("."));

0 commit comments

Comments
 (0)