add sdl3
Needed to change to zig 0.15.2 as well, didn't work with 0.16
This commit is contained in:
67
build.zig
67
build.zig
@@ -93,22 +93,63 @@ pub fn build(b: *std.Build) void {
|
||||
omt_mod.addLibraryPath(lib_output_path);
|
||||
omt_mod.addIncludePath(include_output_path);
|
||||
|
||||
// Main executable
|
||||
const omtoy_exe = b.addExecutable(.{
|
||||
.name = "omtoy",
|
||||
.root_module = b.createModule(.{
|
||||
.root_source_file = b.path("src/main.zig"),
|
||||
.target = target,
|
||||
.optimize = optimize,
|
||||
}),
|
||||
const sdl3 = b.dependency("sdl3", .{
|
||||
.target = target,
|
||||
.optimize = optimize,
|
||||
|
||||
// Lib options.
|
||||
// .callbacks = false,
|
||||
// .ext_image = false,
|
||||
// .ext_net = false,
|
||||
// .ext_ttf = false,
|
||||
// .log_message_stack_size = 1024,
|
||||
// .main = false,
|
||||
// .renderer_debug_text_stack_size = 1024,
|
||||
|
||||
// Options passed directly to https://github.com/castholm/SDL (SDL3 C Bindings):
|
||||
// .c_sdl_preferred_linkage = .static,
|
||||
// .c_sdl_strip = false,
|
||||
// .c_sdl_sanitize_c = .off,
|
||||
// .c_sdl_lto = .none,
|
||||
// .c_sdl_emscripten_pthreads = false,
|
||||
// .c_sdl_install_build_config_h = false,
|
||||
|
||||
// Options if `ext_image` is enabled:
|
||||
// .image_enable_bmp = true,
|
||||
// .image_enable_gif = true,
|
||||
// .image_enable_jpg = true,
|
||||
// .image_enable_lbm = true,
|
||||
// .image_enable_pcx = true,
|
||||
// .image_enable_png = true,
|
||||
// .image_enable_pnm = true,
|
||||
// .image_enable_qoi = true,
|
||||
// .image_enable_svg = true,
|
||||
// .image_enable_tga = true,
|
||||
// .image_enable_xcf = true,
|
||||
// .image_enable_xpm = true,
|
||||
// .image_enable_xv = true,
|
||||
});
|
||||
|
||||
b.installArtifact(omtoy_exe);
|
||||
{
|
||||
// Main executable
|
||||
const omtoy_exe = b.addExecutable(.{
|
||||
.name = "omtoy",
|
||||
.root_module = b.createModule(.{
|
||||
.root_source_file = b.path("src/main.zig"),
|
||||
.target = target,
|
||||
.optimize = optimize,
|
||||
}),
|
||||
});
|
||||
|
||||
const omtoy_run_step = b.step("run", "Run omtoy");
|
||||
const omtoy_run = b.addRunArtifact(omtoy_exe);
|
||||
omtoy_run_step.dependOn(&omtoy_run);
|
||||
omtoy_run.step.dependOn(b.getInstallStep());
|
||||
omtoy_exe.root_module.addImport("sdl3", sdl3.module("sdl3"));
|
||||
b.installArtifact(omtoy_exe);
|
||||
|
||||
// Run step for main executable
|
||||
const run_step = b.step("run", "Run omtoy");
|
||||
const run_cmd = b.addRunArtifact(omtoy_exe);
|
||||
run_step.dependOn(&run_cmd.step);
|
||||
run_cmd.step.dependOn(b.getInstallStep());
|
||||
}
|
||||
|
||||
// Util executables
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user