chore: SDL2.zig expects target to be set before link() is called

This commit is contained in:
Rekai Nyangadzayi Musuka 2022-10-21 05:13:02 -03:00
parent 1d7dfe71ca
commit 68a87e0a54
1 changed files with 2 additions and 2 deletions

View File

@ -13,6 +13,8 @@ pub fn build(b: *std.build.Builder) void {
const mode = b.standardReleaseOptions(); const mode = b.standardReleaseOptions();
const exe = b.addExecutable("zba", "src/main.zig"); const exe = b.addExecutable("zba", "src/main.zig");
exe.setTarget(target);
// Known Folders (%APPDATA%, XDG, etc.) // Known Folders (%APPDATA%, XDG, etc.)
exe.addPackagePath("known_folders", "lib/known-folders/known-folders.zig"); exe.addPackagePath("known_folders", "lib/known-folders/known-folders.zig");
@ -29,10 +31,8 @@ pub fn build(b: *std.build.Builder) void {
// Zig SDL Bindings: https://github.com/MasterQ32/SDL.zig // Zig SDL Bindings: https://github.com/MasterQ32/SDL.zig
const sdk = Sdk.init(b); const sdk = Sdk.init(b);
sdk.link(exe, .dynamic); sdk.link(exe, .dynamic);
exe.addPackage(sdk.getNativePackage("sdl2")); exe.addPackage(sdk.getNativePackage("sdl2"));
exe.setTarget(target);
exe.setBuildMode(mode); exe.setBuildMode(mode);
exe.install(); exe.install();