mirror of
https://github.com/NeoFlock/neonucleus.git
synced 2025-09-24 09:03:32 +02:00
make build script respect -Dtarget
This commit is contained in:
parent
2d4bec8734
commit
67a178db81
14
build.zig
14
build.zig
@ -31,11 +31,13 @@ const LuaVersion = enum {
|
|||||||
lua54,
|
lua54,
|
||||||
};
|
};
|
||||||
|
|
||||||
fn compileRaylib(b: *std.Build, os: std.Target.Os.Tag, c: *std.Build.Step.Compile) void {
|
fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, c: *std.Build.Step.Compile) void {
|
||||||
const raylib = b.dependency("raylib", .{});
|
const raylib = b.dependency("raylib", .{
|
||||||
|
.target = target,
|
||||||
|
});
|
||||||
c.addIncludePath(raylib.path(raylib.builder.h_dir));
|
c.addIncludePath(raylib.path(raylib.builder.h_dir));
|
||||||
c.linkLibrary(raylib.artifact("raylib"));
|
c.linkLibrary(raylib.artifact("raylib"));
|
||||||
if (os == .windows) {
|
if (target.result.os.tag == .windows) {
|
||||||
c.linkSystemLibrary("WinMM");
|
c.linkSystemLibrary("WinMM");
|
||||||
c.linkSystemLibrary("GDI32");
|
c.linkSystemLibrary("GDI32");
|
||||||
}
|
}
|
||||||
@ -82,10 +84,10 @@ fn getSharedEngineName(os: std.Target.Os.Tag) []const u8 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn build(b: *std.Build) void {
|
pub fn build(b: *std.Build) void {
|
||||||
const os = builtin.target.os.tag;
|
|
||||||
|
|
||||||
const target = b.standardTargetOptions(.{});
|
const target = b.standardTargetOptions(.{});
|
||||||
|
|
||||||
|
const os = target.result.os.tag;
|
||||||
|
|
||||||
const optimize = b.standardOptimizeOption(.{});
|
const optimize = b.standardOptimizeOption(.{});
|
||||||
|
|
||||||
const includeFiles = b.addInstallHeaderFile(b.path("src/neonucleus.h"), "neonucleus.h");
|
const includeFiles = b.addInstallHeaderFile(b.path("src/neonucleus.h"), "neonucleus.h");
|
||||||
@ -124,7 +126,7 @@ pub fn build(b: *std.Build) void {
|
|||||||
});
|
});
|
||||||
emulator.linkLibC();
|
emulator.linkLibC();
|
||||||
|
|
||||||
compileRaylib(b, os, emulator);
|
compileRaylib(b, target, emulator);
|
||||||
|
|
||||||
const luaVer = b.option(LuaVersion, "lua", "The version of Lua to use.") orelse LuaVersion.lua54;
|
const luaVer = b.option(LuaVersion, "lua", "The version of Lua to use.") orelse LuaVersion.lua54;
|
||||||
emulator.addCSourceFiles(.{
|
emulator.addCSourceFiles(.{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user