Skip to content

Commit

Permalink
feat: update build files to account for changes introduced in ziglang…
Browse files Browse the repository at this point in the history
  • Loading branch information
yamashitax committed Apr 13, 2024
1 parent a2916c3 commit 659741b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
3 changes: 1 addition & 2 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ const std = @import("std");
const Build = std.Build;
const Step = Build.Step;
const Module = Build.Module;
const LazyPath = Build.LazyPath;

const MODULE_NAME = "curl";

Expand Down Expand Up @@ -63,7 +62,7 @@ fn addExample(
) !void {
const exe = b.addExecutable(.{
.name = name,
.root_source_file = LazyPath.relative("examples/" ++ name ++ ".zig"),
.root_source_file = b.path("examples/" ++ name ++ ".zig"),
.target = target,
.optimize = optimize,
});
Expand Down
2 changes: 1 addition & 1 deletion libs/curl.zig
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pub fn create(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.bui
lib.addCSourceFiles(.{ .files = srcs });
lib.addIncludePath(.{ .path = "libs/curl/lib" });
lib.addIncludePath(.{ .path = "libs/curl/include" });
lib.installHeadersDirectory("libs/curl/include/curl", "curl");
lib.installHeadersDirectory(.{ .path = "libs/curl/include/curl" }, "curl", .{});
lib.linkLibC();
lib.defineCMacro("BUILDING_LIBCURL", null);
lib.defineCMacro("CURL_STATICLIB", "1");
Expand Down
4 changes: 2 additions & 2 deletions libs/mbedtls.zig
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ pub fn create(b: *std.Build, target: ResolvedTarget, optimize: std.builtin.Optim
lib.addIncludePath(.{ .path = "libs/mbedtls/include" });
lib.addIncludePath(.{ .path = "libs/mbedtls/library" });
lib.linkLibC();
lib.installHeadersDirectory("libs/mbedtls/include/mbedtls", "mbedtls");
lib.installHeadersDirectory("libs/mbedtls/include/psa", "psa");
lib.installHeadersDirectory(.{ .path = "libs/mbedtls/include/mbedtls" }, "mbedtls", .{});
lib.installHeadersDirectory(.{ .path = "libs/mbedtls/include/psa" }, "psa", .{});

if (target.result.os.tag == .windows) {
lib.linkSystemLibrary("ws2_32");
Expand Down
4 changes: 2 additions & 2 deletions libs/zlib.zig
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ pub fn create(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.bui
});
lib.linkLibC();
lib.addCSourceFiles(.{ .files = srcs, .flags = &.{"-std=c89"} });
lib.installHeader("libs/zlib/zlib.h", "zlib.h");
lib.installHeader("libs/zlib/zconf.h", "zconf.h");
lib.installHeader(.{ .path = "libs/zlib/zlib.h" }, "zlib.h");
lib.installHeader(.{ .path = "libs/zlib/zconf.h" }, "zconf.h");
return lib;
}

Expand Down

0 comments on commit 659741b

Please sign in to comment.