Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions build/luajit.zig
Original file line number Diff line number Diff line change
Expand Up @@ -127,17 +127,22 @@ pub fn configure(b: *Build, target: Build.ResolvedTarget, optimize: std.builtin.

const buildvm_c_flags: []const []const u8 = switch (target.result.cpu.arch) {
.aarch64, .aarch64_be => &.{ "-DLUAJIT_TARGET=LUAJIT_ARCH_arm64", "-DLJ_ARCH_HASFPU=1", "-DLJ_ABI_SOFTFP=0" },
.x86_64 => &.{ "-DLUAJIT_TARGET=LUAJIT_ARCH_X64" },
.x86_64 => &.{"-DLUAJIT_TARGET=LUAJIT_ARCH_X64"},
else => &.{},
};

const buildvm_windows_c_flags: []const []const u8 = if (target.result.os.tag == .windows)
&.{"-DLUAJIT_OS=1"}
else
&.{};

buildvm.addCSourceFiles(.{
.root = .{ .dependency = .{
.dependency = upstream,
.sub_path = "",
} },
.files = &.{ "src/host/buildvm_asm.c", "src/host/buildvm_fold.c", "src/host/buildvm_lib.c", "src/host/buildvm_peobj.c", "src/host/buildvm.c" },
.flags = buildvm_c_flags,
.flags = std.mem.concat(b.allocator, []const u8, &.{ buildvm_c_flags, buildvm_windows_c_flags }) catch @panic("OOM!"),
});

buildvm.addIncludePath(upstream.path("src"));
Expand Down
Loading