tins2023/allegro/build.zig

25 lines
821 B
Zig
Raw Permalink Normal View History

const std = @import("std");
fn current_file() []const u8 {
return @src().file;
}
const cwd = std.fs.path.dirname(current_file()).?;
const path_separator = std.fs.path.sep_str;
/// add this package to exe
pub fn addTo(comptime allegro_dir: []const u8, exe: *std.build.LibExeObjStep) void {
exe.addAnonymousModule("allegro", .{ .source_file = .{ .path = cwd ++ path_separator ++ "allegro.zig" } });
if (allegro_dir.len > 0) {
exe.addIncludePath(allegro_dir ++ path_separator ++ "include");
exe.addLibraryPath(allegro_dir ++ path_separator ++ "lib");
}
exe.linkLibC();
exe.linkSystemLibrary("allegro");
exe.linkSystemLibrary("allegro_font");
exe.linkSystemLibrary("allegro_image");
exe.linkSystemLibrary("allegro_memfile");
exe.linkSystemLibrary("allegro_ttf");
}