57 lines
1.8 KiB
Zig
57 lines
1.8 KiB
Zig
const std = @import("std");
|
|
const Backlog = @import("Backlog");
|
|
|
|
pub fn build(b: *std.Build) void {
|
|
const target = b.standardTargetOptions(.{});
|
|
const optimize = b.standardOptimizeOption(.{});
|
|
|
|
var blbuild = Backlog.init(b, .{
|
|
.target = target,
|
|
.optimize = optimize,
|
|
.backlogRoot = "../",
|
|
});
|
|
|
|
const sampleGame = blbuild.addProgram(.{
|
|
.name = "sampleGame",
|
|
.desc = "sdl3 project sample",
|
|
.root_source_file = b.path("sampleGame/main.zig"),
|
|
});
|
|
|
|
// new build api
|
|
//
|
|
// const game:BlProgram = blbuild.addProgram(...)
|
|
// game.addExtraModule(...)
|
|
// game.setModuleEnabled("physics", true);
|
|
// game.setModuleEnabled("audio", true);
|
|
// game.setModuleEnabled("audio", true);
|
|
//
|
|
//// commits changes and adds compile steps to the builder
|
|
// const sampleGame = game.addCompileSteps();
|
|
//
|
|
|
|
blbuild.addExtraModule(sampleGame, "gameExtras");
|
|
blbuild.addExtraModule(sampleGame, "videoplayer");
|
|
blbuild.addExtraModule(sampleGame, "doomplayer");
|
|
blbuild.addExtraModule(sampleGame, "bsp");
|
|
|
|
// external reload modules
|
|
const sampleGameExtern = b.addSharedLibrary(.{
|
|
.root_source_file = b.path("sampleGame/externGame/externGame.zig"),
|
|
.link_libc = true,
|
|
.optimize = optimize,
|
|
.target = target,
|
|
.name = "externGame",
|
|
});
|
|
|
|
blbuild.addExtraModule(sampleGameExtern.root_module, "gameExtras");
|
|
blbuild.addExtraModule(sampleGameExtern.root_module, "bsp");
|
|
sampleGameExtern.root_module.addImport("backlog", blbuild.nw_mod);
|
|
|
|
const installExtern = b.addInstallArtifact(sampleGameExtern, .{
|
|
.dest_dir = .{ .override = .{ .custom = "modules" } },
|
|
});
|
|
b.getInstallStep().dependOn(&installExtern.step);
|
|
|
|
blbuild.addDependencyInstalls(b, .ReleaseFast); //.ReleaseFast);
|
|
}
|