From 072635a38c72f42e6224be15cbe752ae71001b0e Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Wed, 31 Jan 2024 21:26:04 -0700 Subject: [PATCH] add addPathsToModule functionality Signed-off-by: Stephen Gutekanst --- build.zig | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/build.zig b/build.zig index fbfd72d4..77f51f95 100644 --- a/build.zig +++ b/build.zig @@ -11,6 +11,7 @@ pub fn build(b: *std.Build) void { .optimize = optimize, }); addPaths(lib); // just for testing + addPathsToModule(&lib.root_module); // just for testing lib.linkLibC(); lib.installHeadersDirectory("include", "."); b.installArtifact(lib); @@ -22,6 +23,12 @@ pub fn addPaths(step: *std.Build.Step.Compile) void { step.addLibraryPath(.{ .path = sdkPath("/lib") }); } +pub fn addPathsToModule(mod: *std.Build.Module) void { + mod.addSystemFrameworkPath(.{ .path = sdkPath("/Frameworks") }); + mod.addSystemIncludePath(.{ .path = sdkPath("/include") }); + mod.addLibraryPath(.{ .path = sdkPath("/lib") }); +} + fn sdkPath(comptime suffix: []const u8) []const u8 { if (suffix[0] != '/') @compileError("suffix must be an absolute path"); return comptime blk: {