47 lines
1.2 KiB
Zig
47 lines
1.2 KiB
Zig
const std = @import("std");
|
|
|
|
pub fn build(b: *std.Build) void {
|
|
const optimize = b.standardOptimizeOption(.{});
|
|
const target = b.standardTargetOptions(.{});
|
|
|
|
// solver
|
|
const solver_mod = b.addModule("solver", .{
|
|
.root_source_file = b.path("src/solver.zig"),
|
|
.optimize = optimize,
|
|
.target = target,
|
|
});
|
|
|
|
const solver_exe = b.addExecutable(.{
|
|
.name = "solver",
|
|
.root_module = solver_mod,
|
|
});
|
|
|
|
if (target.result.cpu.arch == .wasm32) {
|
|
solver_exe.entry = .disabled;
|
|
solver_exe.rdynamic = true;
|
|
solver_exe.link_gc_sections = true;
|
|
solver_exe.lto = .full;
|
|
}
|
|
|
|
b.installArtifact(solver_exe);
|
|
|
|
// validator
|
|
const validator_mod = b.addModule("validator", .{
|
|
.root_source_file = b.path("src/validator.zig"),
|
|
.optimize = optimize,
|
|
.target = target,
|
|
});
|
|
|
|
const validator_exe = b.addExecutable(.{
|
|
.name = "validator",
|
|
.root_module = validator_mod,
|
|
});
|
|
|
|
if (target.result.cpu.arch == .wasm32) {
|
|
validator_exe.entry = .disabled;
|
|
validator_exe.rdynamic = true;
|
|
}
|
|
|
|
b.installArtifact(validator_exe);
|
|
}
|