1043 lines
31 KiB
Zig
1043 lines
31 KiB
Zig
const std = @import("std");
|
|||
|
|
const zon: ZonConfig = @import("build.zig.zon");
|
||
|
|
|
||
|
|
const Build = std.Build;
|
||
|
|
const Step = std.Build.Step;
|
||
|
|
|
||
|
|
pub fn build(b: *Build) !void {
|
||
|
|
const target = b.standardTargetOptions(.{});
|
||
|
|
const optimize = b.standardOptimizeOption(.{});
|
||
|
|
|
||
|
|
// Remove the default install and uninstall steps
|
||
|
|
b.top_level_steps = .{};
|
||
|
|
|
||
|
|
var tag_parts = std.mem.splitBackwardsScalar(u8, zon.dependencies.luau.url, '#');
|
||
|
|
var version_parts = std.mem.splitScalar(u8, tag_parts.first(), '.');
|
||
|
|
const major_parsed = try std.json.parseFromSlice(u32, b.allocator, version_parts.next().?, .{});
|
||
|
|
const minor_parsed = try std.json.parseFromSlice(u32, b.allocator, version_parts.next().?, .{});
|
||
|
|
|
||
|
|
const major = major_parsed.value;
|
||
|
|
major_parsed.deinit();
|
||
|
|
const minor = minor_parsed.value;
|
||
|
|
minor_parsed.deinit();
|
||
|
|
|
||
|
|
const version = std.SemanticVersion{ .major = major, .minor = minor, .patch = 0 };
|
||
|
|
|
||
|
|
const luau_dep = b.dependency("luau", .{});
|
||
|
|
|
||
|
|
const build_Ast = b.option(bool, "Ast", "Build Luau Ast") orelse true;
|
||
|
|
const build_CodeGen = b.option(bool, "CodeGen", "Build Luau CodeGen") orelse switch (target.result.cpu.arch) {
|
||
|
|
.x86_64, .aarch64 => true,
|
||
|
|
else => false,
|
||
|
|
};
|
||
|
|
const build_Analysis = b.option(bool, "Analysis", "Build Luau Analysis") orelse switch (target.result.cpu.arch) {
|
||
|
|
.wasm32, .wasm64 => false,
|
||
|
|
.powerpc64, .powerpc64le => false,
|
||
|
|
.loongarch64 => false,
|
||
|
|
else => true,
|
||
|
|
};
|
||
|
|
const build_Compiler = b.option(bool, "Compiler", "Build Luau Compiler") orelse true;
|
||
|
|
const build_VM = b.option(bool, "VM", "Build Luau VM") orelse true;
|
||
|
|
const build_Inliner = b.option(bool, "Inliner", "Build Luau Inliner") orelse true;
|
||
|
|
|
||
|
|
const use_zig_backend = b.option(bool, "use_zig_backend", "Build Luau with zig written backend") orelse true;
|
||
|
|
const use_4_vector = b.option(bool, "use_4_vector", "Build Luau to use 4-vectors instead of the default 3-vector.") orelse false;
|
||
|
|
|
||
|
|
const use_longjmp = b.option(bool, "use_longjmp", "Build Luau with SJLJ instead of exceptions (applies to CodeGen and VM)") orelse true;
|
||
|
|
|
||
|
|
const wasm_cxa_exceptions = b.option(bool, "wasm_cxa_exceptions", "Enable exception cxa implementation") orelse true;
|
||
|
|
|
||
|
|
const hard_stack_tests = b.option(bool, "hard_stack_tests", "Enable hard stack tests") orelse false;
|
||
|
|
const hard_mem_tests = b.option(u8, "hard_mem_tests", "Enable hard memory tests") orelse 0;
|
||
|
|
|
||
|
|
const no_llvm = b.option(bool, "no_llvm", "Build without llvm (tests only + best with zig backend)") orelse false;
|
||
|
|
const no_bin = b.option(bool, "no_bin", "Build without binary artifacts") orelse false;
|
||
|
|
|
||
|
|
const cxxflags = b.option([]const []const u8, "cxxflag", "Build C/C++ compile flags") orelse &.{};
|
||
|
|
|
||
|
|
// Expose build configuration to the zig-luau module
|
||
|
|
const config = b.addOptions();
|
||
|
|
config.addOption(bool, "use_4_vector", use_4_vector);
|
||
|
|
config.addOption(bool, "use_zig_backend", use_zig_backend);
|
||
|
|
config.addOption(u8, "hard_mem_tests", hard_mem_tests);
|
||
|
|
config.addOption(bool, "hard_stack_tests", hard_stack_tests);
|
||
|
|
config.addOption(bool, "wasm_cxa_exceptions", wasm_cxa_exceptions);
|
||
|
|
config.addOption(std.SemanticVersion, "luau_version", version);
|
||
|
|
|
||
|
|
config.addOption(bool, "buildAst", build_Ast);
|
||
|
|
config.addOption(bool, "buildCodeGen", build_CodeGen);
|
||
|
|
config.addOption(bool, "buildAnalysis", build_Analysis);
|
||
|
|
config.addOption(bool, "buildCompiler", build_Compiler);
|
||
|
|
config.addOption(bool, "buildVM", build_VM);
|
||
|
|
config.addOption(bool, "buildInliner", build_Inliner);
|
||
|
|
|
||
|
|
// Luau C Headers
|
||
|
|
const headers = b.addTranslateC(.{
|
||
|
|
.root_source_file = b.path("src/bridge.h"),
|
||
|
|
.target = target,
|
||
|
|
.optimize = optimize,
|
||
|
|
});
|
||
|
|
headers.addIncludePath(luau_dep.path("Compiler/include"));
|
||
|
|
headers.addIncludePath(luau_dep.path("VM/include"));
|
||
|
|
switch (target.result.cpu.arch) {
|
||
|
|
.x86_64, .aarch64 => headers.addIncludePath(luau_dep.path("CodeGen/include")),
|
||
|
|
else => {},
|
||
|
|
}
|
||
|
|
|
||
|
|
const c_module = headers.createModule();
|
||
|
|
|
||
|
|
var FLAGS: std.ArrayList([]const u8) = .empty;
|
||
|
|
|
||
|
|
try FLAGS.append(b.allocator, "-DLUA_USE_LONGJMP=" ++ if (use_longjmp) "1" else "0");
|
||
|
|
try FLAGS.append(b.allocator, "-DLUA_API=extern\"C\"");
|
||
|
|
try FLAGS.append(b.allocator, "-DLUACODE_API=extern\"C\"");
|
||
|
|
try FLAGS.append(b.allocator, "-DLUACODEGEN_API=extern\"C\"");
|
||
|
|
try FLAGS.append(b.allocator, "-DLUAJITINLINER_API=extern\"C\"");
|
||
|
|
if (hard_mem_tests > 0)
|
||
|
|
try FLAGS.append(b.allocator, b.fmt("-DHARDMEMTESTS={d}", .{hard_mem_tests}));
|
||
|
|
if (hard_stack_tests)
|
||
|
|
try FLAGS.append(b.allocator, "-DHARDSTACKTESTS");
|
||
|
|
if (use_4_vector)
|
||
|
|
try FLAGS.append(b.allocator, "-DLUA_VECTOR_SIZE=4");
|
||
|
|
|
||
|
|
for (cxxflags) |flag| {
|
||
|
|
try FLAGS.append(b.allocator, flag);
|
||
|
|
}
|
||
|
|
|
||
|
|
const compile_flags = FLAGS.items;
|
||
|
|
|
||
|
|
const libCommon = buildCommon(b, target, luau_dep, optimize, version, compile_flags);
|
||
|
|
const libAst = buildAst(b, target, luau_dep, optimize, version, compile_flags, libCommon);
|
||
|
|
const libBytecode = buildBytecode(b, target, luau_dep, optimize, version, compile_flags, libCommon);
|
||
|
|
const libCompiler = buildCompiler(b, target, luau_dep, optimize, version, compile_flags, libAst, libBytecode);
|
||
|
|
const libVM = buildVM(b, target, luau_dep, optimize, version, compile_flags, libCommon);
|
||
|
|
const libInliner = buildInliner(b, target, luau_dep, optimize, version, compile_flags, libVM, libBytecode);
|
||
|
|
const libConfig = buildConfig(b, target, luau_dep, optimize, version, compile_flags, libCommon, libAst, libCompiler, libVM);
|
||
|
|
const libCodeGen = buildCodeGen(b, target, luau_dep, optimize, version, compile_flags, libVM);
|
||
|
|
const libAnalysis = try buildAnalysis(b, target, luau_dep, optimize, version, compile_flags, libAst, libConfig, libCompiler, libVM);
|
||
|
|
|
||
|
|
const mod = b.addModule("root", .{
|
||
|
|
.root_source_file = b.path("src/lib.zig"),
|
||
|
|
.target = target,
|
||
|
|
.optimize = optimize,
|
||
|
|
.link_libcpp = true,
|
||
|
|
});
|
||
|
|
mod.addImport("c", c_module);
|
||
|
|
mod.addOptions("config", config);
|
||
|
|
|
||
|
|
const vector_size: usize = if (use_4_vector) 4 else 3;
|
||
|
|
mod.addCMacro("LUA_VECTOR_SIZE", b.fmt("{}", .{vector_size}));
|
||
|
|
|
||
|
|
mod.addIncludePath(b.path("src"));
|
||
|
|
|
||
|
|
mod.addCSourceFile(.{ .file = b.path("src/bridge.cpp"), .flags = compile_flags });
|
||
|
|
|
||
|
|
if (build_Ast) {
|
||
|
|
linkIncludePath(mod, libAst);
|
||
|
|
mod.linkLibrary(libAst);
|
||
|
|
mod.addCSourceFiles(.{
|
||
|
|
.flags = compile_flags,
|
||
|
|
.root = b.path("src/Ast/"),
|
||
|
|
.files = if (optimize == .Debug or optimize == .ReleaseSafe) &.{
|
||
|
|
"Allocator.cpp",
|
||
|
|
"Lexer.cpp",
|
||
|
|
"Parser.cpp",
|
||
|
|
"Class.cpp",
|
||
|
|
} else &.{
|
||
|
|
"Allocator.cpp",
|
||
|
|
"Lexer.cpp",
|
||
|
|
"Parser.cpp",
|
||
|
|
},
|
||
|
|
});
|
||
|
|
}
|
||
|
|
if (build_Analysis) {
|
||
|
|
linkIncludePath(mod, libAnalysis);
|
||
|
|
mod.linkLibrary(libAnalysis);
|
||
|
|
mod.addCSourceFiles(.{
|
||
|
|
.flags = compile_flags,
|
||
|
|
.root = b.path("src/Analysis/"),
|
||
|
|
.files = &.{
|
||
|
|
"FileUtils.cpp",
|
||
|
|
"AstJsonEncoder.cpp",
|
||
|
|
"Frontend.cpp",
|
||
|
|
"FileResolver.cpp",
|
||
|
|
"GenericConfigResolver.cpp",
|
||
|
|
},
|
||
|
|
});
|
||
|
|
}
|
||
|
|
if (build_CodeGen) {
|
||
|
|
linkIncludePath(mod, libCodeGen);
|
||
|
|
mod.linkLibrary(libCodeGen);
|
||
|
|
}
|
||
|
|
if (build_Compiler) {
|
||
|
|
linkIncludePath(mod, libCompiler);
|
||
|
|
mod.linkLibrary(libCompiler);
|
||
|
|
mod.addCSourceFile(.{
|
||
|
|
.file = b.path("src/Compiler/Compiler.cpp"),
|
||
|
|
.flags = compile_flags,
|
||
|
|
});
|
||
|
|
}
|
||
|
|
if (build_VM) {
|
||
|
|
linkIncludePath(mod, libVM);
|
||
|
|
mod.linkLibrary(libVM);
|
||
|
|
if (optimize == .Debug or optimize == .ReleaseSafe) {
|
||
|
|
mod.addCSourceFile(.{
|
||
|
|
.file = b.path("src/VM/acc.cpp"),
|
||
|
|
.flags = compile_flags,
|
||
|
|
});
|
||
|
|
mod.addIncludePath(luau_dep.path("VM/src"));
|
||
|
|
}
|
||
|
|
}
|
||
|
|
if (build_Inliner) {
|
||
|
|
linkIncludePath(mod, libInliner);
|
||
|
|
mod.linkLibrary(libInliner);
|
||
|
|
}
|
||
|
|
|
||
|
|
const lib = b.addLibrary(.{
|
||
|
|
.name = "luau",
|
||
|
|
.root_module = mod,
|
||
|
|
.linkage = .static,
|
||
|
|
.version = version,
|
||
|
|
});
|
||
|
|
|
||
|
|
// It may not be as likely that other software links against Luau, but might as well expose these anyway
|
||
|
|
lib.installHeader(luau_dep.path("VM/include/lua.h"), "lua.h");
|
||
|
|
lib.installHeader(luau_dep.path("VM/include/lualib.h"), "lualib.h");
|
||
|
|
lib.installHeader(luau_dep.path("VM/include/luaconf.h"), "luaconf.h");
|
||
|
|
if (build_CodeGen)
|
||
|
|
lib.installHeader(luau_dep.path("CodeGen/include/luacodegen.h"), "luacodegen.h");
|
||
|
|
|
||
|
|
if (!no_bin)
|
||
|
|
b.installArtifact(lib);
|
||
|
|
|
||
|
|
const lib_tests = b.addTest(.{
|
||
|
|
.name = if (use_zig_backend) "zig-lib-tests" else "lib-tests",
|
||
|
|
.root_module = mod,
|
||
|
|
.use_llvm = !no_llvm,
|
||
|
|
});
|
||
|
|
|
||
|
|
// Tests
|
||
|
|
const tests = b.addTest(.{
|
||
|
|
.name = if (use_zig_backend) "zig-tests" else "tests",
|
||
|
|
.root_module = b.createModule(.{
|
||
|
|
.root_source_file = b.path("src/tests.zig"),
|
||
|
|
.target = target,
|
||
|
|
.optimize = optimize,
|
||
|
|
}),
|
||
|
|
.use_llvm = !no_llvm,
|
||
|
|
});
|
||
|
|
tests.root_module.addImport("luau", mod);
|
||
|
|
|
||
|
|
const run_lib_tests = b.addRunArtifact(lib_tests);
|
||
|
|
const run_tests = b.addRunArtifact(tests);
|
||
|
|
const test_step = b.step("test", "Run zig-luau tests");
|
||
|
|
test_step.dependOn(&run_lib_tests.step);
|
||
|
|
test_step.dependOn(&run_tests.step);
|
||
|
|
|
||
|
|
if (!no_bin) {
|
||
|
|
b.installArtifact(lib_tests);
|
||
|
|
b.installArtifact(tests);
|
||
|
|
}
|
||
|
|
|
||
|
|
// Examples
|
||
|
|
const examples = [_]struct { []const u8, []const u8 }{
|
||
|
|
.{ "luau-bytecode", "examples/luau-bytecode.zig" },
|
||
|
|
.{ "repl", "examples/repl.zig" },
|
||
|
|
.{ "zig-fn", "examples/zig-fn.zig" },
|
||
|
|
};
|
||
|
|
|
||
|
|
for (examples) |example| {
|
||
|
|
const exe = b.addExecutable(.{
|
||
|
|
.name = example[0],
|
||
|
|
.root_module = b.createModule(.{
|
||
|
|
.root_source_file = b.path(example[1]),
|
||
|
|
.target = target,
|
||
|
|
.optimize = optimize,
|
||
|
|
}),
|
||
|
|
});
|
||
|
|
exe.root_module.addImport("luau", mod);
|
||
|
|
|
||
|
|
const artifact = b.addInstallArtifact(exe, .{});
|
||
|
|
const exe_step = b.step(b.fmt("install-example-{s}", .{example[0]}), b.fmt("Install {s} example", .{example[0]}));
|
||
|
|
exe_step.dependOn(&artifact.step);
|
||
|
|
|
||
|
|
const run_cmd = b.addRunArtifact(exe);
|
||
|
|
run_cmd.step.dependOn(b.getInstallStep());
|
||
|
|
if (b.args) |args|
|
||
|
|
run_cmd.addArgs(args);
|
||
|
|
|
||
|
|
const run_step = b.step(b.fmt("run-example-{s}", .{example[0]}), b.fmt("Run {s} example", .{example[0]}));
|
||
|
|
run_step.dependOn(&run_cmd.step);
|
||
|
|
}
|
||
|
|
|
||
|
|
const docs = b.addLibrary(.{
|
||
|
|
.name = "luau",
|
||
|
|
.root_module = mod,
|
||
|
|
});
|
||
|
|
|
||
|
|
const install_docs = b.addInstallDirectory(.{
|
||
|
|
.source_dir = docs.getEmittedDocs(),
|
||
|
|
.install_dir = .prefix,
|
||
|
|
.install_subdir = "docs",
|
||
|
|
});
|
||
|
|
|
||
|
|
const docs_step = b.step("docs", "Build and install the documentation");
|
||
|
|
docs_step.dependOn(&install_docs.step);
|
||
|
|
}
|
||
|
|
|
||
|
|
fn buildAndLinkModule(
|
||
|
|
b: *Build,
|
||
|
|
target: Build.ResolvedTarget,
|
||
|
|
dependency: *Build.Dependency,
|
||
|
|
module: *Build.Module,
|
||
|
|
config: *Step.Options,
|
||
|
|
c_module: *Build.Module,
|
||
|
|
lib: *Step.Compile,
|
||
|
|
use_4_vector: bool,
|
||
|
|
) !void {
|
||
|
|
module.addImport("c", c_module);
|
||
|
|
|
||
|
|
module.addOptions("config", config);
|
||
|
|
|
||
|
|
const vector_size: usize = if (use_4_vector) 4 else 3;
|
||
|
|
module.addCMacro("LUA_VECTOR_SIZE", b.fmt("{}", .{vector_size}));
|
||
|
|
|
||
|
|
module.addIncludePath(dependency.path("Compiler/include"));
|
||
|
|
module.addIncludePath(dependency.path("VM/include"));
|
||
|
|
switch (target.result.cpu.arch) {
|
||
|
|
.x86_64, .aarch64 => module.addIncludePath(dependency.path("CodeGen/include")),
|
||
|
|
else => {},
|
||
|
|
}
|
||
|
|
|
||
|
|
module.linkLibrary(lib);
|
||
|
|
}
|
||
|
|
|
||
|
|
pub fn addModuleExportSymbols(b: *Build, module: *Build.Module) void {
|
||
|
|
if (module.resolved_target.?.result.cpu.arch.isWasm()) {
|
||
|
|
var old_export_symbols = std.ArrayList([]const u8).init(b.allocator);
|
||
|
|
old_export_symbols.appendSlice(module.export_symbol_names) catch @panic("OOM");
|
||
|
|
old_export_symbols.appendSlice(&.{
|
||
|
|
"zig_luau_try_impl",
|
||
|
|
"zig_luau_catch_impl",
|
||
|
|
}) catch @panic("OOM");
|
||
|
|
module.export_symbol_names = old_export_symbols.toOwnedSlice() catch @panic("OOM");
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
fn linkIncludePath(
|
||
|
|
module: *Build.Module,
|
||
|
|
source: *Step.Compile,
|
||
|
|
) void {
|
||
|
|
for (source.root_module.include_dirs.items) |dir|
|
||
|
|
switch (dir) {
|
||
|
|
.path => |path| blk: {
|
||
|
|
for (module.include_dirs.items) |target_dir|
|
||
|
|
if (target_dir == .path and
|
||
|
|
path == .dependency and target_dir.path == .dependency and
|
||
|
|
path.dependency.dependency == target_dir.path.dependency.dependency and
|
||
|
|
std.mem.eql(u8, path.dependency.sub_path, target_dir.path.dependency.sub_path))
|
||
|
|
break :blk;
|
||
|
|
|
||
|
|
module.addIncludePath(path);
|
||
|
|
},
|
||
|
|
else => {},
|
||
|
|
};
|
||
|
|
}
|
||
|
|
|
||
|
|
fn buildCommon(
|
||
|
|
b: *Build,
|
||
|
|
target: Build.ResolvedTarget,
|
||
|
|
dependency: *Build.Dependency,
|
||
|
|
optimize: std.builtin.OptimizeMode,
|
||
|
|
version: std.SemanticVersion,
|
||
|
|
flags: []const []const u8,
|
||
|
|
) *Step.Compile {
|
||
|
|
const mod = b.createModule(.{
|
||
|
|
.target = target,
|
||
|
|
.optimize = optimize,
|
||
|
|
.link_libcpp = true,
|
||
|
|
});
|
||
|
|
|
||
|
|
const lib = b.addLibrary(.{
|
||
|
|
.name = "Common",
|
||
|
|
.linkage = .static,
|
||
|
|
.root_module = mod,
|
||
|
|
.version = version,
|
||
|
|
});
|
||
|
|
|
||
|
|
for (LUAU_Common_HEADERS_DIRS) |dir|
|
||
|
|
mod.addIncludePath(dependency.path(dir));
|
||
|
|
|
||
|
|
mod.addCSourceFiles(.{
|
||
|
|
.root = dependency.path(""),
|
||
|
|
.files = &LUAU_Common_SOURCE_FILES,
|
||
|
|
.flags = flags,
|
||
|
|
});
|
||
|
|
|
||
|
|
return lib;
|
||
|
|
}
|
||
|
|
|
||
|
|
fn buildAst(
|
||
|
|
b: *Build,
|
||
|
|
target: Build.ResolvedTarget,
|
||
|
|
dependency: *Build.Dependency,
|
||
|
|
optimize: std.builtin.OptimizeMode,
|
||
|
|
version: std.SemanticVersion,
|
||
|
|
flags: []const []const u8,
|
||
|
|
libCommon: *Step.Compile,
|
||
|
|
) *Step.Compile {
|
||
|
|
const mod = b.createModule(.{
|
||
|
|
.target = target,
|
||
|
|
.optimize = optimize,
|
||
|
|
.link_libcpp = true,
|
||
|
|
});
|
||
|
|
|
||
|
|
const lib = b.addLibrary(.{
|
||
|
|
.name = "Ast",
|
||
|
|
.linkage = .static,
|
||
|
|
.root_module = mod,
|
||
|
|
.version = version,
|
||
|
|
});
|
||
|
|
|
||
|
|
linkIncludePath(mod, libCommon);
|
||
|
|
mod.linkLibrary(libCommon);
|
||
|
|
|
||
|
|
for (LUAU_Ast_HEADERS_DIRS) |dir|
|
||
|
|
mod.addIncludePath(dependency.path(dir));
|
||
|
|
|
||
|
|
mod.addCSourceFiles(.{
|
||
|
|
.root = dependency.path(""),
|
||
|
|
.files = &LUAU_Ast_SOURCE_FILES,
|
||
|
|
.flags = flags,
|
||
|
|
});
|
||
|
|
|
||
|
|
return lib;
|
||
|
|
}
|
||
|
|
|
||
|
|
fn buildBytecode(
|
||
|
|
b: *Build,
|
||
|
|
target: Build.ResolvedTarget,
|
||
|
|
dependency: *Build.Dependency,
|
||
|
|
optimize: std.builtin.OptimizeMode,
|
||
|
|
version: std.SemanticVersion,
|
||
|
|
flags: []const []const u8,
|
||
|
|
libCommon: *Step.Compile,
|
||
|
|
) *Step.Compile {
|
||
|
|
const mod = b.createModule(.{
|
||
|
|
.target = target,
|
||
|
|
.optimize = optimize,
|
||
|
|
.link_libcpp = true,
|
||
|
|
});
|
||
|
|
|
||
|
|
const lib = b.addLibrary(.{
|
||
|
|
.name = "Bytecode",
|
||
|
|
.linkage = .static,
|
||
|
|
.root_module = mod,
|
||
|
|
.version = version,
|
||
|
|
});
|
||
|
|
|
||
|
|
linkIncludePath(mod, libCommon);
|
||
|
|
mod.linkLibrary(libCommon);
|
||
|
|
|
||
|
|
for (LUAU_Bytecode_HEADERS_DIRS) |dir|
|
||
|
|
mod.addIncludePath(dependency.path(dir));
|
||
|
|
|
||
|
|
mod.addCSourceFiles(.{
|
||
|
|
.root = dependency.path(""),
|
||
|
|
.files = &LUAU_Bytecode_SOURCE_FILES,
|
||
|
|
.flags = flags,
|
||
|
|
});
|
||
|
|
|
||
|
|
return lib;
|
||
|
|
}
|
||
|
|
|
||
|
|
fn buildCompiler(
|
||
|
|
b: *Build,
|
||
|
|
target: Build.ResolvedTarget,
|
||
|
|
dependency: *Build.Dependency,
|
||
|
|
optimize: std.builtin.OptimizeMode,
|
||
|
|
version: std.SemanticVersion,
|
||
|
|
flags: []const []const u8,
|
||
|
|
libAst: *Step.Compile,
|
||
|
|
libBytecode: *Step.Compile,
|
||
|
|
) *Step.Compile {
|
||
|
|
const mod = b.createModule(.{
|
||
|
|
.target = target,
|
||
|
|
.optimize = optimize,
|
||
|
|
.link_libcpp = true,
|
||
|
|
});
|
||
|
|
|
||
|
|
const lib = b.addLibrary(.{
|
||
|
|
.name = "Compiler",
|
||
|
|
.linkage = .static,
|
||
|
|
.root_module = mod,
|
||
|
|
.version = version,
|
||
|
|
});
|
||
|
|
|
||
|
|
linkIncludePath(mod, libAst);
|
||
|
|
linkIncludePath(mod, libBytecode);
|
||
|
|
mod.linkLibrary(libAst);
|
||
|
|
mod.linkLibrary(libBytecode);
|
||
|
|
|
||
|
|
for (LUAU_Compiler_HEADERS_DIRS) |dir|
|
||
|
|
mod.addIncludePath(dependency.path(dir));
|
||
|
|
|
||
|
|
mod.addCSourceFiles(.{
|
||
|
|
.root = dependency.path(""),
|
||
|
|
.files = &LUAU_Compiler_SOURCE_FILES,
|
||
|
|
.flags = flags,
|
||
|
|
});
|
||
|
|
|
||
|
|
return lib;
|
||
|
|
}
|
||
|
|
|
||
|
|
fn buildConfig(
|
||
|
|
b: *Build,
|
||
|
|
target: Build.ResolvedTarget,
|
||
|
|
dependency: *Build.Dependency,
|
||
|
|
optimize: std.builtin.OptimizeMode,
|
||
|
|
version: std.SemanticVersion,
|
||
|
|
flags: []const []const u8,
|
||
|
|
libCommon: *Step.Compile,
|
||
|
|
libAst: *Step.Compile,
|
||
|
|
libCompiler: *Step.Compile,
|
||
|
|
libVM: *Step.Compile,
|
||
|
|
) *Step.Compile {
|
||
|
|
const mod = b.createModule(.{
|
||
|
|
.target = target,
|
||
|
|
.optimize = optimize,
|
||
|
|
.link_libcpp = true,
|
||
|
|
});
|
||
|
|
|
||
|
|
const lib = b.addLibrary(.{
|
||
|
|
.name = "Config",
|
||
|
|
.linkage = .static,
|
||
|
|
.root_module = mod,
|
||
|
|
.version = version,
|
||
|
|
});
|
||
|
|
|
||
|
|
linkIncludePath(mod, libCommon);
|
||
|
|
linkIncludePath(mod, libAst);
|
||
|
|
linkIncludePath(mod, libCompiler);
|
||
|
|
linkIncludePath(mod, libVM);
|
||
|
|
|
||
|
|
mod.linkLibrary(libCommon);
|
||
|
|
mod.linkLibrary(libAst);
|
||
|
|
mod.linkLibrary(libCompiler);
|
||
|
|
mod.linkLibrary(libVM);
|
||
|
|
|
||
|
|
for (LUAU_Config_HEADERS_DIRS) |dir|
|
||
|
|
mod.addIncludePath(dependency.path(dir));
|
||
|
|
|
||
|
|
mod.addCSourceFiles(.{
|
||
|
|
.root = dependency.path(""),
|
||
|
|
.files = &LUAU_Config_SOURCE_FILES,
|
||
|
|
.flags = flags,
|
||
|
|
});
|
||
|
|
|
||
|
|
return lib;
|
||
|
|
}
|
||
|
|
|
||
|
|
fn buildAnalysis(
|
||
|
|
b: *Build,
|
||
|
|
target: Build.ResolvedTarget,
|
||
|
|
dependency: *Build.Dependency,
|
||
|
|
optimize: std.builtin.OptimizeMode,
|
||
|
|
version: std.SemanticVersion,
|
||
|
|
flags: []const []const u8,
|
||
|
|
libAst: *Step.Compile,
|
||
|
|
libConfig: *Step.Compile,
|
||
|
|
libCompiler: *Step.Compile,
|
||
|
|
libVM: *Step.Compile,
|
||
|
|
) !*Step.Compile {
|
||
|
|
const mod = b.createModule(.{
|
||
|
|
.target = target,
|
||
|
|
.optimize = optimize,
|
||
|
|
.link_libcpp = true,
|
||
|
|
});
|
||
|
|
|
||
|
|
const lib = b.addLibrary(.{
|
||
|
|
.name = "Analysis",
|
||
|
|
.linkage = .static,
|
||
|
|
.root_module = mod,
|
||
|
|
.version = version,
|
||
|
|
});
|
||
|
|
|
||
|
|
linkIncludePath(mod, libAst);
|
||
|
|
linkIncludePath(mod, libConfig);
|
||
|
|
linkIncludePath(mod, libCompiler);
|
||
|
|
linkIncludePath(mod, libVM);
|
||
|
|
|
||
|
|
mod.linkLibrary(libAst);
|
||
|
|
mod.linkLibrary(libConfig);
|
||
|
|
mod.linkLibrary(libCompiler);
|
||
|
|
mod.linkLibrary(libVM);
|
||
|
|
|
||
|
|
for (LUAU_Analysis_HEADERS_DIRS) |dir|
|
||
|
|
mod.addIncludePath(dependency.path(dir));
|
||
|
|
|
||
|
|
mod.addCSourceFiles(.{
|
||
|
|
.root = dependency.path(""),
|
||
|
|
.files = &LUAU_Analysis_SOURCE_FILES,
|
||
|
|
.flags = flags,
|
||
|
|
});
|
||
|
|
|
||
|
|
return lib;
|
||
|
|
}
|
||
|
|
|
||
|
|
fn buildCodeGen(
|
||
|
|
b: *Build,
|
||
|
|
target: Build.ResolvedTarget,
|
||
|
|
dependency: *Build.Dependency,
|
||
|
|
optimize: std.builtin.OptimizeMode,
|
||
|
|
version: std.SemanticVersion,
|
||
|
|
flags: []const []const u8,
|
||
|
|
libVM: *Step.Compile,
|
||
|
|
) *Step.Compile {
|
||
|
|
const mod = b.createModule(.{
|
||
|
|
.target = target,
|
||
|
|
.optimize = optimize,
|
||
|
|
.link_libcpp = true,
|
||
|
|
});
|
||
|
|
|
||
|
|
const lib = b.addLibrary(.{
|
||
|
|
.name = "CodeGen",
|
||
|
|
.linkage = .static,
|
||
|
|
.root_module = mod,
|
||
|
|
.version = version,
|
||
|
|
});
|
||
|
|
|
||
|
|
linkIncludePath(mod, libVM);
|
||
|
|
mod.linkLibrary(libVM);
|
||
|
|
|
||
|
|
for (LUAU_CodeGen_HEADERS_DIRS) |dir|
|
||
|
|
mod.addIncludePath(dependency.path(dir));
|
||
|
|
|
||
|
|
mod.addCSourceFiles(.{
|
||
|
|
.root = dependency.path(""),
|
||
|
|
.files = &LUAU_CodeGen_SOURCE_FILES,
|
||
|
|
.flags = flags,
|
||
|
|
});
|
||
|
|
|
||
|
|
return lib;
|
||
|
|
}
|
||
|
|
|
||
|
|
fn buildVM(
|
||
|
|
b: *Build,
|
||
|
|
target: Build.ResolvedTarget,
|
||
|
|
dependency: *Build.Dependency,
|
||
|
|
optimize: std.builtin.OptimizeMode,
|
||
|
|
version: std.SemanticVersion,
|
||
|
|
flags: []const []const u8,
|
||
|
|
libCommon: *Step.Compile,
|
||
|
|
) *Step.Compile {
|
||
|
|
const mod = b.createModule(.{
|
||
|
|
.target = target,
|
||
|
|
.optimize = optimize,
|
||
|
|
.link_libcpp = true,
|
||
|
|
});
|
||
|
|
|
||
|
|
const lib = b.addLibrary(.{
|
||
|
|
.name = "VM",
|
||
|
|
.linkage = .static,
|
||
|
|
.root_module = mod,
|
||
|
|
.version = version,
|
||
|
|
});
|
||
|
|
|
||
|
|
linkIncludePath(mod, libCommon);
|
||
|
|
|
||
|
|
for (LUAU_VM_HEADERS_DIRS) |dir|
|
||
|
|
mod.addIncludePath(dependency.path(dir));
|
||
|
|
|
||
|
|
mod.addCSourceFiles(.{
|
||
|
|
.root = dependency.path(""),
|
||
|
|
.files = &LUAU_VM_SOURCE_FILES,
|
||
|
|
.flags = flags,
|
||
|
|
});
|
||
|
|
|
||
|
|
return lib;
|
||
|
|
}
|
||
|
|
|
||
|
|
fn buildInliner(
|
||
|
|
b: *Build,
|
||
|
|
target: Build.ResolvedTarget,
|
||
|
|
dependency: *Build.Dependency,
|
||
|
|
optimize: std.builtin.OptimizeMode,
|
||
|
|
version: std.SemanticVersion,
|
||
|
|
flags: []const []const u8,
|
||
|
|
libVM: *Step.Compile,
|
||
|
|
libBytecode: *Step.Compile,
|
||
|
|
) *Step.Compile {
|
||
|
|
const mod = b.createModule(.{
|
||
|
|
.target = target,
|
||
|
|
.optimize = optimize,
|
||
|
|
.link_libcpp = true,
|
||
|
|
});
|
||
|
|
|
||
|
|
const lib = b.addLibrary(.{
|
||
|
|
.name = "Inliner",
|
||
|
|
.linkage = .static,
|
||
|
|
.root_module = mod,
|
||
|
|
.version = version,
|
||
|
|
});
|
||
|
|
|
||
|
|
linkIncludePath(mod, libVM);
|
||
|
|
linkIncludePath(mod, libBytecode);
|
||
|
|
mod.linkLibrary(libVM);
|
||
|
|
mod.linkLibrary(libBytecode);
|
||
|
|
|
||
|
|
for (LUAU_Inliner_HEADERS_DIRS) |dir|
|
||
|
|
mod.addIncludePath(dependency.path(dir));
|
||
|
|
|
||
|
|
mod.addCSourceFiles(.{
|
||
|
|
.root = dependency.path(""),
|
||
|
|
.files = &LUAU_Inliner_SOURCE_FILES,
|
||
|
|
.flags = flags,
|
||
|
|
});
|
||
|
|
|
||
|
|
return lib;
|
||
|
|
}
|
||
|
|
|
||
|
|
fn buildRequire(
|
||
|
|
b: *Build,
|
||
|
|
target: Build.ResolvedTarget,
|
||
|
|
dependency: *Build.Dependency,
|
||
|
|
optimize: std.builtin.OptimizeMode,
|
||
|
|
version: std.SemanticVersion,
|
||
|
|
flags: []const []const u8,
|
||
|
|
libVM: *Step.Compile,
|
||
|
|
libRequireNavigator: *Step.Compile,
|
||
|
|
) *Step.Compile {
|
||
|
|
const mod = b.createModule(.{
|
||
|
|
.target = target,
|
||
|
|
.optimize = optimize,
|
||
|
|
.link_libcpp = true,
|
||
|
|
});
|
||
|
|
|
||
|
|
const lib = b.addLibrary(.{
|
||
|
|
.name = "Require",
|
||
|
|
.target = target,
|
||
|
|
.optimize = optimize,
|
||
|
|
.version = version,
|
||
|
|
});
|
||
|
|
|
||
|
|
linkIncludePath(mod, libVM);
|
||
|
|
linkIncludePath(mod, libRequireNavigator);
|
||
|
|
|
||
|
|
for (LUAU_Require_HEADERS_DIRS) |dir|
|
||
|
|
mod.addIncludePath(dependency.path(dir));
|
||
|
|
|
||
|
|
mod.addCSourceFiles(.{
|
||
|
|
.root = dependency.path(""),
|
||
|
|
.files = &LUAU_Require_SOURCE_FILES,
|
||
|
|
.flags = flags,
|
||
|
|
});
|
||
|
|
|
||
|
|
return lib;
|
||
|
|
}
|
||
|
|
|
||
|
|
fn buildRequireNavigator(
|
||
|
|
b: *Build,
|
||
|
|
target: Build.ResolvedTarget,
|
||
|
|
dependency: *Build.Dependency,
|
||
|
|
optimize: std.builtin.OptimizeMode,
|
||
|
|
version: std.SemanticVersion,
|
||
|
|
flags: []const []const u8,
|
||
|
|
libConfig: *Step.Compile,
|
||
|
|
) *Step.Compile {
|
||
|
|
const mod = b.createModule(.{
|
||
|
|
.target = target,
|
||
|
|
.optimize = optimize,
|
||
|
|
.link_libcpp = true,
|
||
|
|
});
|
||
|
|
|
||
|
|
const lib = b.addLibrary(.{
|
||
|
|
.name = "RequireNavigator",
|
||
|
|
.target = target,
|
||
|
|
.optimize = optimize,
|
||
|
|
.version = version,
|
||
|
|
});
|
||
|
|
|
||
|
|
linkIncludePath(mod, libConfig);
|
||
|
|
|
||
|
|
mod.linkLibCpp();
|
||
|
|
|
||
|
|
for (LUAU_RequireNavigator_HEADERS_DIRS) |dir|
|
||
|
|
mod.addIncludePath(dependency.path(dir));
|
||
|
|
|
||
|
|
mod.addCSourceFiles(.{
|
||
|
|
.root = dependency.path(""),
|
||
|
|
.files = &LUAU_RequireNavigator_SOURCE_FILES,
|
||
|
|
.flags = flags,
|
||
|
|
});
|
||
|
|
|
||
|
|
return lib;
|
||
|
|
}
|
||
|
|
|
||
|
|
const LUAU_Analysis_HEADERS_DIRS = [_][]const u8{
|
||
|
|
"Analysis/include/",
|
||
|
|
"Analysis/src/",
|
||
|
|
};
|
||
|
|
const LUAU_Analysis_SOURCE_FILES = [_][]const u8{
|
||
|
|
"Analysis/src/Anyification.cpp",
|
||
|
|
"Analysis/src/ApplyTypeFunction.cpp",
|
||
|
|
"Analysis/src/AstJsonEncoder.cpp",
|
||
|
|
"Analysis/src/AstQuery.cpp",
|
||
|
|
"Analysis/src/AstUtils.cpp",
|
||
|
|
"Analysis/src/Autocomplete.cpp",
|
||
|
|
"Analysis/src/AutocompleteCore.cpp",
|
||
|
|
"Analysis/src/BuiltinDefinitions.cpp",
|
||
|
|
"Analysis/src/BuiltinTypeFunctions.cpp",
|
||
|
|
"Analysis/src/Clone.cpp",
|
||
|
|
"Analysis/src/Constraint.cpp",
|
||
|
|
"Analysis/src/ConstraintGenerator.cpp",
|
||
|
|
"Analysis/src/ConstraintGraph.cpp",
|
||
|
|
"Analysis/src/ConstraintSolver.cpp",
|
||
|
|
"Analysis/src/ControlFlowGraph.cpp",
|
||
|
|
"Analysis/src/DataFlowGraph.cpp",
|
||
|
|
"Analysis/src/DcrLogger.cpp",
|
||
|
|
"Analysis/src/DumpCFG.cpp",
|
||
|
|
"Analysis/src/Def.cpp",
|
||
|
|
"Analysis/src/EmbeddedBuiltinDefinitions.cpp",
|
||
|
|
"Analysis/src/Error.cpp",
|
||
|
|
"Analysis/src/ExpectedTypeVisitor.cpp",
|
||
|
|
"Analysis/src/FileResolver.cpp",
|
||
|
|
"Analysis/src/FragmentAutocomplete.cpp",
|
||
|
|
"Analysis/src/Frontend.cpp",
|
||
|
|
"Analysis/src/Generalization.cpp",
|
||
|
|
"Analysis/src/GlobalTypes.cpp",
|
||
|
|
"Analysis/src/Instantiation.cpp",
|
||
|
|
"Analysis/src/Instantiation2.cpp",
|
||
|
|
"Analysis/src/IostreamHelpers.cpp",
|
||
|
|
"Analysis/src/IterativeTypeVisitor.cpp",
|
||
|
|
"Analysis/src/IterativeTypeFunctionTypeVisitor.cpp",
|
||
|
|
"Analysis/src/JsonEmitter.cpp",
|
||
|
|
"Analysis/src/Linter.cpp",
|
||
|
|
"Analysis/src/LValue.cpp",
|
||
|
|
"Analysis/src/Module.cpp",
|
||
|
|
"Analysis/src/NativeStackGuard.cpp",
|
||
|
|
"Analysis/src/NonStrictTypeChecker.cpp",
|
||
|
|
"Analysis/src/Normalize.cpp",
|
||
|
|
"Analysis/src/OverloadResolver.cpp",
|
||
|
|
"Analysis/src/Quantify.cpp",
|
||
|
|
"Analysis/src/RecursionCounter.cpp",
|
||
|
|
"Analysis/src/Refinement.cpp",
|
||
|
|
"Analysis/src/RequireTracer.cpp",
|
||
|
|
"Analysis/src/Scope.cpp",
|
||
|
|
"Analysis/src/Simplify.cpp",
|
||
|
|
"Analysis/src/StructuralTypeEquality.cpp",
|
||
|
|
"Analysis/src/Substitution.cpp",
|
||
|
|
"Analysis/src/Subtyping.cpp",
|
||
|
|
"Analysis/src/SubtypingUnifier.cpp",
|
||
|
|
"Analysis/src/Symbol.cpp",
|
||
|
|
"Analysis/src/TableLiteralInference.cpp",
|
||
|
|
"Analysis/src/ToDot.cpp",
|
||
|
|
"Analysis/src/TopoSortStatements.cpp",
|
||
|
|
"Analysis/src/ToString.cpp",
|
||
|
|
"Analysis/src/TxnLog.cpp",
|
||
|
|
"Analysis/src/Type.cpp",
|
||
|
|
"Analysis/src/TypeArena.cpp",
|
||
|
|
"Analysis/src/TypeAttach.cpp",
|
||
|
|
"Analysis/src/TypeChecker2.cpp",
|
||
|
|
"Analysis/src/TypedAllocator.cpp",
|
||
|
|
"Analysis/src/TypeFunction.cpp",
|
||
|
|
"Analysis/src/TypeFunctionError.cpp",
|
||
|
|
"Analysis/src/TypeFunctionReductionGuesser.cpp",
|
||
|
|
"Analysis/src/TypeFunctionRuntime.cpp",
|
||
|
|
"Analysis/src/TypeFunctionRuntimeBuilder.cpp",
|
||
|
|
"Analysis/src/TypeIds.cpp",
|
||
|
|
"Analysis/src/TypeInfer.cpp",
|
||
|
|
"Analysis/src/TypeOrPack.cpp",
|
||
|
|
"Analysis/src/TypePack.cpp",
|
||
|
|
"Analysis/src/TypePath.cpp",
|
||
|
|
"Analysis/src/TypeStateMap.cpp",
|
||
|
|
"Analysis/src/TypeUtils.cpp",
|
||
|
|
"Analysis/src/Unifiable.cpp",
|
||
|
|
"Analysis/src/Unifier.cpp",
|
||
|
|
"Analysis/src/Unifier2.cpp",
|
||
|
|
"Analysis/src/UserDefinedTypeFunction.cpp",
|
||
|
|
};
|
||
|
|
|
||
|
|
const LUAU_Ast_HEADERS_DIRS = [_][]const u8{
|
||
|
|
"Ast/include/",
|
||
|
|
};
|
||
|
|
const LUAU_Ast_SOURCE_FILES = [_][]const u8{
|
||
|
|
"Ast/src/Ast.cpp",
|
||
|
|
"Ast/src/Cst.cpp",
|
||
|
|
"Ast/src/Allocator.cpp",
|
||
|
|
"Ast/src/Confusables.cpp",
|
||
|
|
"Ast/src/Lexer.cpp",
|
||
|
|
"Ast/src/Location.cpp",
|
||
|
|
"Ast/src/Parser.cpp",
|
||
|
|
"Ast/src/PrettyPrinter.cpp",
|
||
|
|
};
|
||
|
|
|
||
|
|
const LUAU_Bytecode_HEADERS_DIRS = [_][]const u8{
|
||
|
|
"Bytecode/include/",
|
||
|
|
"Bytecode/src/",
|
||
|
|
};
|
||
|
|
const LUAU_Bytecode_SOURCE_FILES = [_][]const u8{
|
||
|
|
"Bytecode/src/BytecodeBuilder.cpp",
|
||
|
|
"Bytecode/src/BytecodeGraph.cpp",
|
||
|
|
"Bytecode/src/Sccp.cpp",
|
||
|
|
};
|
||
|
|
|
||
|
|
const LUAU_Inliner_HEADERS_DIRS = [_][]const u8{
|
||
|
|
"Inliner/include/",
|
||
|
|
"Inliner/src/",
|
||
|
|
};
|
||
|
|
const LUAU_Inliner_SOURCE_FILES = [_][]const u8{
|
||
|
|
"Inliner/src/JitInliner.cpp",
|
||
|
|
"Inliner/src/luajitinliner.cpp",
|
||
|
|
};
|
||
|
|
|
||
|
|
const LUAU_CodeGen_HEADERS_DIRS = [_][]const u8{
|
||
|
|
"CodeGen/include/",
|
||
|
|
"CodeGen/src/",
|
||
|
|
};
|
||
|
|
const LUAU_CodeGen_SOURCE_FILES = [_][]const u8{
|
||
|
|
"CodeGen/src/AssemblyBuilderA64.cpp",
|
||
|
|
"CodeGen/src/AssemblyBuilderX64.cpp",
|
||
|
|
"CodeGen/src/CodeAllocator.cpp",
|
||
|
|
"CodeGen/src/CodeBlockUnwind.cpp",
|
||
|
|
"CodeGen/src/CodeGen.cpp",
|
||
|
|
"CodeGen/src/CodeGenAssembly.cpp",
|
||
|
|
"CodeGen/src/CodeGenContext.cpp",
|
||
|
|
"CodeGen/src/CodeGenUtils.cpp",
|
||
|
|
"CodeGen/src/CodeGenA64.cpp",
|
||
|
|
"CodeGen/src/CodeGenX64.cpp",
|
||
|
|
"CodeGen/src/EmitBuiltinsX64.cpp",
|
||
|
|
"CodeGen/src/EmitCommonX64.cpp",
|
||
|
|
"CodeGen/src/EmitInstructionX64.cpp",
|
||
|
|
"CodeGen/src/IrAnalysis.cpp",
|
||
|
|
"CodeGen/src/IrBuilder.cpp",
|
||
|
|
"CodeGen/src/IrCallWrapperX64.cpp",
|
||
|
|
"CodeGen/src/IrDump.cpp",
|
||
|
|
"CodeGen/src/IrLoweringA64.cpp",
|
||
|
|
"CodeGen/src/IrLoweringX64.cpp",
|
||
|
|
"CodeGen/src/IrRegAllocA64.cpp",
|
||
|
|
"CodeGen/src/IrRegAllocX64.cpp",
|
||
|
|
"CodeGen/src/IrTranslateBuiltins.cpp",
|
||
|
|
"CodeGen/src/IrTranslation.cpp",
|
||
|
|
"CodeGen/src/IrUtils.cpp",
|
||
|
|
"CodeGen/src/IrValueLocationTracking.cpp",
|
||
|
|
"CodeGen/src/lcodegen.cpp",
|
||
|
|
"CodeGen/src/NativeProtoExecData.cpp",
|
||
|
|
"CodeGen/src/NativeState.cpp",
|
||
|
|
"CodeGen/src/OptimizeConstProp.cpp",
|
||
|
|
"CodeGen/src/OptimizeDeadStore.cpp",
|
||
|
|
"CodeGen/src/OptimizeFinalX64.cpp",
|
||
|
|
"CodeGen/src/UnwindBuilderDwarf2.cpp",
|
||
|
|
"CodeGen/src/UnwindBuilderWin.cpp",
|
||
|
|
"CodeGen/src/BytecodeAnalysis.cpp",
|
||
|
|
"CodeGen/src/BytecodeSummary.cpp",
|
||
|
|
"CodeGen/src/SharedCodeAllocator.cpp",
|
||
|
|
};
|
||
|
|
|
||
|
|
const LUAU_Common_HEADERS_DIRS = [_][]const u8{
|
||
|
|
"Common/include/",
|
||
|
|
};
|
||
|
|
const LUAU_Common_SOURCE_FILES = [_][]const u8{
|
||
|
|
"Common/src/StringUtils.cpp",
|
||
|
|
"Common/src/TimeTrace.cpp",
|
||
|
|
"Common/src/BytecodeWire.cpp",
|
||
|
|
};
|
||
|
|
|
||
|
|
const LUAU_Compiler_HEADERS_DIRS = [_][]const u8{
|
||
|
|
"Compiler/include/",
|
||
|
|
"Compiler/src/",
|
||
|
|
};
|
||
|
|
const LUAU_Compiler_SOURCE_FILES = [_][]const u8{
|
||
|
|
"Compiler/src/BuiltinFolding.cpp",
|
||
|
|
"Compiler/src/Builtins.cpp",
|
||
|
|
"Compiler/src/Compiler.cpp",
|
||
|
|
"Compiler/src/ConstantFolding.cpp",
|
||
|
|
"Compiler/src/CostModel.cpp",
|
||
|
|
"Compiler/src/TableShape.cpp",
|
||
|
|
"Compiler/src/Types.cpp",
|
||
|
|
"Compiler/src/ValueTracking.cpp",
|
||
|
|
"Compiler/src/lcode.cpp",
|
||
|
|
};
|
||
|
|
|
||
|
|
const LUAU_Config_HEADERS_DIRS = [_][]const u8{
|
||
|
|
"Config/include/",
|
||
|
|
};
|
||
|
|
const LUAU_Config_SOURCE_FILES = [_][]const u8{
|
||
|
|
"Config/src/Config.cpp",
|
||
|
|
"Config/src/LuauConfig.cpp",
|
||
|
|
"Config/src/LinterConfig.cpp",
|
||
|
|
};
|
||
|
|
|
||
|
|
const LUAU_Require_HEADERS_DIRS = [_][]const u8{
|
||
|
|
"Require/Runtime/include/",
|
||
|
|
"Require/Runtime/src/",
|
||
|
|
};
|
||
|
|
const LUAU_Require_SOURCE_FILES = [_][]const u8{
|
||
|
|
"Require/Runtime/src/Navigation.cpp",
|
||
|
|
"Require/Runtime/src/Require.cpp",
|
||
|
|
"Require/Runtime/src/RequireImpl.cpp",
|
||
|
|
};
|
||
|
|
|
||
|
|
const LUAU_RequireNavigator_HEADERS_DIRS = [_][]const u8{
|
||
|
|
"Require/Navigator/include/",
|
||
|
|
};
|
||
|
|
const LUAU_RequireNavigator_SOURCE_FILES = [_][]const u8{
|
||
|
|
"Require/Navigator/src/PathUtilities.cpp",
|
||
|
|
"Require/Navigator/src/RequireNavigator.cpp",
|
||
|
|
};
|
||
|
|
|
||
|
|
const LUAU_VM_HEADERS_DIRS = [_][]const u8{
|
||
|
|
"VM/include/",
|
||
|
|
"VM/src/",
|
||
|
|
};
|
||
|
|
|
||
|
|
const LUAU_VM_SOURCE_FILES = [_][]const u8{
|
||
|
|
"VM/src/lapi.cpp",
|
||
|
|
"VM/src/laux.cpp",
|
||
|
|
"VM/src/lbaselib.cpp",
|
||
|
|
"VM/src/lbitlib.cpp",
|
||
|
|
"VM/src/lbuffer.cpp",
|
||
|
|
"VM/src/lbuflib.cpp",
|
||
|
|
"VM/src/lbuiltins.cpp",
|
||
|
|
"VM/src/lclass.cpp",
|
||
|
|
"VM/src/lclasslib.cpp",
|
||
|
|
"VM/src/lcorolib.cpp",
|
||
|
|
"VM/src/ldblib.cpp",
|
||
|
|
"VM/src/ldebug.cpp",
|
||
|
|
"VM/src/ldo.cpp",
|
||
|
|
"VM/src/lfunc.cpp",
|
||
|
|
"VM/src/lgc.cpp",
|
||
|
|
"VM/src/lgcdebug.cpp",
|
||
|
|
"VM/src/linit.cpp",
|
||
|
|
"VM/src/lintlib.cpp",
|
||
|
|
"VM/src/lmathlib.cpp",
|
||
|
|
"VM/src/lmem.cpp",
|
||
|
|
"VM/src/lnumprint.cpp",
|
||
|
|
"VM/src/lobject.cpp",
|
||
|
|
"VM/src/loslib.cpp",
|
||
|
|
"VM/src/lperf.cpp",
|
||
|
|
"VM/src/lstate.cpp",
|
||
|
|
"VM/src/lstring.cpp",
|
||
|
|
"VM/src/lstrlib.cpp",
|
||
|
|
"VM/src/ltable.cpp",
|
||
|
|
"VM/src/ltablib.cpp",
|
||
|
|
"VM/src/ltm.cpp",
|
||
|
|
"VM/src/ludata.cpp",
|
||
|
|
"VM/src/lutf8lib.cpp",
|
||
|
|
"VM/src/lvmexecute.cpp",
|
||
|
|
"VM/src/lveclib.cpp",
|
||
|
|
"VM/src/lvmload.cpp",
|
||
|
|
"VM/src/lvmutils.cpp",
|
||
|
|
};
|
||
|
|
|
||
|
|
const ZonConfig = struct {
|
||
|
|
name: enum { luau },
|
||
|
|
fingerprint: u64,
|
||
|
|
version: []const u8,
|
||
|
|
minimum_zig_version: []const u8,
|
||
|
|
dependencies: struct {
|
||
|
|
luau: struct { url: []const u8, hash: []const u8 },
|
||
|
|
},
|
||
|
|
paths: []const []const u8,
|
||
|
|
};
|