update build
This commit is contained in:
parent
4b6a05cd10
commit
ce24a5be9b
2 changed files with 27 additions and 41 deletions
58
build.zig
58
build.zig
|
|
@ -16,38 +16,6 @@ const Program = struct {
|
||||||
desc: []const u8,
|
desc: []const u8,
|
||||||
};
|
};
|
||||||
|
|
||||||
fn getRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.builtin.OptimizeMode, options: Options) *std.Build.Step.Compile {
|
|
||||||
const raylib_dep = b.dependency("raylib", .{
|
|
||||||
.target = target,
|
|
||||||
.optimize = optimize,
|
|
||||||
.raudio = options.raudio,
|
|
||||||
.rmodels = options.rmodels,
|
|
||||||
.rshapes = options.rshapes,
|
|
||||||
.rtext = options.rtext,
|
|
||||||
.rtextures = options.rtextures,
|
|
||||||
.platform = options.platform,
|
|
||||||
.linkage = options.linkage,
|
|
||||||
.linux_display_backend = options.linux_display_backend,
|
|
||||||
.opengl_version = options.opengl_version,
|
|
||||||
.android_api_version = options.android_api_version,
|
|
||||||
.android_ndk = options.android_ndk,
|
|
||||||
.config = options.config,
|
|
||||||
});
|
|
||||||
|
|
||||||
const raylib = raylib_dep.artifact("raylib");
|
|
||||||
|
|
||||||
const raygui_dep = b.dependency("raygui", .{
|
|
||||||
.target = target,
|
|
||||||
.optimize = optimize,
|
|
||||||
.link_libc = true,
|
|
||||||
});
|
|
||||||
|
|
||||||
rl.addRaygui(b, raylib, raygui_dep, options);
|
|
||||||
|
|
||||||
b.installArtifact(raylib);
|
|
||||||
return raylib;
|
|
||||||
}
|
|
||||||
|
|
||||||
fn getModule(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.builtin.OptimizeMode) *std.Build.Module {
|
fn getModule(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.builtin.OptimizeMode) *std.Build.Module {
|
||||||
if (b.modules.contains("raylib")) {
|
if (b.modules.contains("raylib")) {
|
||||||
return b.modules.get("raylib").?;
|
return b.modules.get("raylib").?;
|
||||||
|
|
@ -56,7 +24,6 @@ fn getModule(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.buil
|
||||||
.root_source_file = b.path("lib/raylib.zig"),
|
.root_source_file = b.path("lib/raylib.zig"),
|
||||||
.target = target,
|
.target = target,
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
.link_libc = true,
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -68,7 +35,6 @@ const gui = struct {
|
||||||
.imports = &.{.{ .name = "raylib-zig", .module = raylib }},
|
.imports = &.{.{ .name = "raylib-zig", .module = raylib }},
|
||||||
.target = target,
|
.target = target,
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
.link_libc = true,
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -77,7 +43,27 @@ pub fn build(b: *std.Build) !void {
|
||||||
const target = b.standardTargetOptions(.{});
|
const target = b.standardTargetOptions(.{});
|
||||||
const optimize = b.standardOptimizeOption(.{});
|
const optimize = b.standardOptimizeOption(.{});
|
||||||
|
|
||||||
const raylib_artifact = this.getRaylib(b, target, optimize, Options.getOptions(b));
|
const raylib_options = Options.getOptions(b);
|
||||||
|
const raylib_dep = b.dependency("raylib", .{
|
||||||
|
.target = target,
|
||||||
|
.optimize = optimize,
|
||||||
|
.raudio = raylib_options.raudio,
|
||||||
|
.raygui = raylib_options.raygui,
|
||||||
|
.rmodels = raylib_options.rmodels,
|
||||||
|
.rshapes = raylib_options.rshapes,
|
||||||
|
.rtext = raylib_options.rtext,
|
||||||
|
.rtextures = raylib_options.rtextures,
|
||||||
|
.platform = raylib_options.platform,
|
||||||
|
.linkage = raylib_options.linkage,
|
||||||
|
.linux_display_backend = raylib_options.linux_display_backend,
|
||||||
|
.opengl_version = raylib_options.opengl_version,
|
||||||
|
.android_api_version = raylib_options.android_api_version,
|
||||||
|
.android_ndk = raylib_options.android_ndk,
|
||||||
|
});
|
||||||
|
|
||||||
|
const raylib_artifact = raylib_dep.artifact("raylib");
|
||||||
|
|
||||||
|
b.installArtifact(raylib_artifact);
|
||||||
const raylib = this.getModule(b, target, optimize);
|
const raylib = this.getModule(b, target, optimize);
|
||||||
const raygui = this.gui.getModule(b, target, optimize);
|
const raygui = this.gui.getModule(b, target, optimize);
|
||||||
|
|
||||||
|
|
@ -456,7 +442,7 @@ pub fn build(b: *std.Build) !void {
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
.flags = emcc_flags,
|
.flags = emcc_flags,
|
||||||
.settings = emcc_settings,
|
.settings = emcc_settings,
|
||||||
.shell_file_path = emsdk.shell(b),
|
.shell_file_path = emsdk.shell(raylib_dep),
|
||||||
.install_dir = install_dir,
|
.install_dir = install_dir,
|
||||||
.embed_paths = &.{.{ .src_path = "resources/" }},
|
.embed_paths = &.{.{ .src_path = "resources/" }},
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -4,12 +4,12 @@
|
||||||
.fingerprint = 0xc4cfa8c610114f28,
|
.fingerprint = 0xc4cfa8c610114f28,
|
||||||
.dependencies = .{
|
.dependencies = .{
|
||||||
.raylib = .{
|
.raylib = .{
|
||||||
.url = "git+https://github.com/raysan5/raylib#f36533cbd8feead845a2e0b4568ec0484a15cd10",
|
.url = "git+https://github.com/raysan5/raylib#a4680fc67734754138650138f11c54dc798ede56",
|
||||||
.hash = "raylib-5.6.0-dev-whq8uGJqKQUEDd38DCov-XG29PYzw3kM_LNbPUkcDGyM",
|
.hash = "raylib-6.0.0-whq8uCSwLgWWeF3ec3dbG6Rr36SLFL-s2WJ1Q_2E22Bb",
|
||||||
},
|
},
|
||||||
.raygui = .{
|
.raygui = .{
|
||||||
.url = "git+https://github.com/raysan5/raygui#3b2855842ab578a034f827c38cf8f62c042fc983",
|
.url = "git+https://github.com/raysan5/raygui#9cdfec460b43a17264af3c181c46f62bf107ac17",
|
||||||
.hash = "N-V-__8AAHvybwBw1kyBGn0BW_s1RqIpycNjLf_XbE-fpLUF",
|
.hash = "N-V-__8AALUbbwDKkSH4nbf3Ml_dTWo9qbELvle5i9eQZMuo",
|
||||||
},
|
},
|
||||||
.emsdk = .{
|
.emsdk = .{
|
||||||
.url = "git+https://github.com/emscripten-core/emsdk#4.0.9",
|
.url = "git+https://github.com/emscripten-core/emsdk#4.0.9",
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
.hash = "zemscripten-0.2.0-dev-sRlDqFJSAAB8hgnRt5DDMKP3zLlDtMnUDwYRJVCa5lGY",
|
.hash = "zemscripten-0.2.0-dev-sRlDqFJSAAB8hgnRt5DDMKP3zLlDtMnUDwYRJVCa5lGY",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
.minimum_zig_version = "0.16.0-dev.3070+b22eb176b",
|
.minimum_zig_version = "0.15.1",
|
||||||
.paths = .{
|
.paths = .{
|
||||||
"build.zig",
|
"build.zig",
|
||||||
"build.zig.zon",
|
"build.zig.zon",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue