Dream of my own C compiler
This commit is contained in:
44
packages/cjit/build.zig
Normal file
44
packages/cjit/build.zig
Normal file
@@ -0,0 +1,44 @@
|
||||
const std = @import("std");
|
||||
|
||||
pub fn build(b: *std.Build) void {
|
||||
const target = b.standardTargetOptions(.{
|
||||
.whitelist = &.{
|
||||
.{
|
||||
.cpu_arch = .x86_64,
|
||||
.os_tag = .windows,
|
||||
.abi = .gnu,
|
||||
},
|
||||
.{
|
||||
.cpu_arch = .x86_64,
|
||||
.os_tag = .linux,
|
||||
.abi = .gnu,
|
||||
},
|
||||
},
|
||||
});
|
||||
const optimize = b.standardOptimizeOption(.{});
|
||||
|
||||
const module = b.addModule("cjit", .{
|
||||
.target = target,
|
||||
.optimize = optimize,
|
||||
.root_source_file = b.path("src/root.zig"),
|
||||
});
|
||||
|
||||
const module_internal_test = b.addTest(.{ .root_module = module });
|
||||
const run_internal_test = b.addRunArtifact(module_internal_test);
|
||||
|
||||
const module_external_test = b.addTest(.{
|
||||
.root_module = b.createModule(.{
|
||||
.target = b.resolveTargetQuery(.{}),
|
||||
.optimize = .Debug,
|
||||
.root_source_file = b.path("test/root.zig"),
|
||||
.imports = &.{
|
||||
.{ .name = "cjit", .module = module },
|
||||
},
|
||||
}),
|
||||
});
|
||||
const run_external_test = b.addRunArtifact(module_external_test);
|
||||
|
||||
const step_test = b.step("test", "Run tests");
|
||||
step_test.dependOn(&run_internal_test.step);
|
||||
step_test.dependOn(&run_external_test.step);
|
||||
}
|
||||
Reference in New Issue
Block a user