add system SDK to build to enable cross compilation

This commit is contained in:
Mitchell Hashimoto
2022-08-17 14:53:34 -07:00
parent 5c2edf4d2a
commit 08292e58f3
4 changed files with 11 additions and 6 deletions

View File

@ -144,7 +144,7 @@ fn addDeps(
// Freetype
step.addPackage(freetype.pkg);
try freetype.link(b, step);
_ = try freetype.link(b, step);
// Glfw
step.addPackage(glfw.pkg);
@ -155,11 +155,13 @@ fn addDeps(
// Libuv
step.addPackage(libuv.pkg);
try libuv.link(b, step);
var libuv_step = try libuv.link(b, step);
system_sdk.include(b, libuv_step, .{});
// Tracy
step.addPackage(tracylib.pkg);
try tracylib.link(b, step);
var tracy_step = try tracylib.link(b, step);
system_sdk.include(b, tracy_step, .{});
}
fn conformanceSteps(

View File

@ -14,11 +14,12 @@ fn thisDir() []const u8 {
return std.fs.path.dirname(@src().file) orelse ".";
}
pub fn link(b: *std.build.Builder, step: *std.build.LibExeObjStep) !void {
pub fn link(b: *std.build.Builder, step: *std.build.LibExeObjStep) !*std.build.LibExeObjStep {
const lib = try buildFreetype(b, step);
step.linkLibrary(lib);
step.addIncludePath(include_path);
step.addIncludePath(include_path_self);
return lib;
}
pub fn buildFreetype(

View File

@ -13,10 +13,11 @@ fn thisDir() []const u8 {
return std.fs.path.dirname(@src().file) orelse ".";
}
pub fn link(b: *std.build.Builder, step: *std.build.LibExeObjStep) !void {
pub fn link(b: *std.build.Builder, step: *std.build.LibExeObjStep) !*std.build.LibExeObjStep {
const libuv = try buildLibuv(b, step);
step.linkLibrary(libuv);
step.addIncludePath(include_path);
return libuv;
}
pub fn buildLibuv(

View File

@ -12,10 +12,11 @@ fn thisDir() []const u8 {
return std.fs.path.dirname(@src().file) orelse ".";
}
pub fn link(b: *std.build.Builder, step: *std.build.LibExeObjStep) !void {
pub fn link(b: *std.build.Builder, step: *std.build.LibExeObjStep) !*std.build.LibExeObjStep {
const tracy = try buildTracy(b, step);
step.linkLibrary(tracy);
step.addIncludePath(root);
return tracy;
}
pub fn buildTracy(