mirror of
https://github.com/ziglang/zig.git
synced 2025-01-27 04:12:25 +00:00
Change deprecated b.host to b.graph.host in tests and Zig's build.zig
This commit is contained in:
parent
76fb2b685b
commit
45c77931c2
@ -72,7 +72,7 @@ pub fn build(b: *std.Build) !void {
|
|||||||
const check_case_exe = b.addExecutable(.{
|
const check_case_exe = b.addExecutable(.{
|
||||||
.name = "check-case",
|
.name = "check-case",
|
||||||
.root_source_file = b.path("test/src/Cases.zig"),
|
.root_source_file = b.path("test/src/Cases.zig"),
|
||||||
.target = b.host,
|
.target = b.graph.host,
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
.single_threaded = single_threaded,
|
.single_threaded = single_threaded,
|
||||||
});
|
});
|
||||||
@ -541,7 +541,7 @@ pub fn build(b: *std.Build) !void {
|
|||||||
const opt_mingw_src_path = b.option([]const u8, "mingw-src", "path to mingw-w64 source directory");
|
const opt_mingw_src_path = b.option([]const u8, "mingw-src", "path to mingw-w64 source directory");
|
||||||
const update_mingw_exe = b.addExecutable(.{
|
const update_mingw_exe = b.addExecutable(.{
|
||||||
.name = "update_mingw",
|
.name = "update_mingw",
|
||||||
.target = b.host,
|
.target = b.graph.host,
|
||||||
.root_source_file = b.path("tools/update_mingw.zig"),
|
.root_source_file = b.path("tools/update_mingw.zig"),
|
||||||
});
|
});
|
||||||
const update_mingw_run = b.addRunArtifact(update_mingw_exe);
|
const update_mingw_run = b.addRunArtifact(update_mingw_exe);
|
||||||
@ -1259,7 +1259,7 @@ fn generateLangRef(b: *std.Build) std.Build.LazyPath {
|
|||||||
const doctest_exe = b.addExecutable(.{
|
const doctest_exe = b.addExecutable(.{
|
||||||
.name = "doctest",
|
.name = "doctest",
|
||||||
.root_source_file = b.path("tools/doctest.zig"),
|
.root_source_file = b.path("tools/doctest.zig"),
|
||||||
.target = b.host,
|
.target = b.graph.host,
|
||||||
.optimize = .Debug,
|
.optimize = .Debug,
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -1297,7 +1297,7 @@ fn generateLangRef(b: *std.Build) std.Build.LazyPath {
|
|||||||
const docgen_exe = b.addExecutable(.{
|
const docgen_exe = b.addExecutable(.{
|
||||||
.name = "docgen",
|
.name = "docgen",
|
||||||
.root_source_file = b.path("tools/docgen.zig"),
|
.root_source_file = b.path("tools/docgen.zig"),
|
||||||
.target = b.host,
|
.target = b.graph.host,
|
||||||
.optimize = .Debug,
|
.optimize = .Debug,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ const Cases = @import("src/Cases.zig");
|
|||||||
|
|
||||||
pub fn addCases(ctx: *Cases, b: *std.Build) !void {
|
pub fn addCases(ctx: *Cases, b: *std.Build) !void {
|
||||||
{
|
{
|
||||||
const case = ctx.obj("multiline error messages", b.host);
|
const case = ctx.obj("multiline error messages", b.graph.host);
|
||||||
|
|
||||||
case.addError(
|
case.addError(
|
||||||
\\comptime {
|
\\comptime {
|
||||||
@ -39,7 +39,7 @@ pub fn addCases(ctx: *Cases, b: *std.Build) !void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
const case = ctx.obj("isolated carriage return in multiline string literal", b.host);
|
const case = ctx.obj("isolated carriage return in multiline string literal", b.graph.host);
|
||||||
|
|
||||||
case.addError("const foo = \\\\\test\r\r rogue carriage return\n;", &[_][]const u8{
|
case.addError("const foo = \\\\\test\r\r rogue carriage return\n;", &[_][]const u8{
|
||||||
":1:19: error: expected ';' after declaration",
|
":1:19: error: expected ';' after declaration",
|
||||||
@ -48,7 +48,7 @@ pub fn addCases(ctx: *Cases, b: *std.Build) !void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
const case = ctx.obj("missing semicolon at EOF", b.host);
|
const case = ctx.obj("missing semicolon at EOF", b.graph.host);
|
||||||
case.addError(
|
case.addError(
|
||||||
\\const foo = 1
|
\\const foo = 1
|
||||||
, &[_][]const u8{
|
, &[_][]const u8{
|
||||||
@ -57,7 +57,7 @@ pub fn addCases(ctx: *Cases, b: *std.Build) !void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
const case = ctx.obj("argument causes error", b.host);
|
const case = ctx.obj("argument causes error", b.graph.host);
|
||||||
|
|
||||||
case.addError(
|
case.addError(
|
||||||
\\pub export fn entry() void {
|
\\pub export fn entry() void {
|
||||||
@ -80,7 +80,7 @@ pub fn addCases(ctx: *Cases, b: *std.Build) !void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
const case = ctx.obj("astgen failure in file struct", b.host);
|
const case = ctx.obj("astgen failure in file struct", b.graph.host);
|
||||||
|
|
||||||
case.addError(
|
case.addError(
|
||||||
\\pub export fn entry() void {
|
\\pub export fn entry() void {
|
||||||
@ -95,7 +95,7 @@ pub fn addCases(ctx: *Cases, b: *std.Build) !void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
const case = ctx.obj("invalid store to comptime field", b.host);
|
const case = ctx.obj("invalid store to comptime field", b.graph.host);
|
||||||
|
|
||||||
case.addError(
|
case.addError(
|
||||||
\\const a = @import("a.zig");
|
\\const a = @import("a.zig");
|
||||||
@ -119,7 +119,7 @@ pub fn addCases(ctx: *Cases, b: *std.Build) !void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
const case = ctx.obj("file in multiple modules", b.host);
|
const case = ctx.obj("file in multiple modules", b.graph.host);
|
||||||
case.addDepModule("foo", "foo.zig");
|
case.addDepModule("foo", "foo.zig");
|
||||||
|
|
||||||
case.addError(
|
case.addError(
|
||||||
@ -138,7 +138,7 @@ pub fn addCases(ctx: *Cases, b: *std.Build) !void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
const case = ctx.obj("wrong same named struct", b.host);
|
const case = ctx.obj("wrong same named struct", b.graph.host);
|
||||||
|
|
||||||
case.addError(
|
case.addError(
|
||||||
\\const a = @import("a.zig");
|
\\const a = @import("a.zig");
|
||||||
@ -172,7 +172,7 @@ pub fn addCases(ctx: *Cases, b: *std.Build) !void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
const case = ctx.obj("non-printable invalid character", b.host);
|
const case = ctx.obj("non-printable invalid character", b.graph.host);
|
||||||
|
|
||||||
case.addError("\xff\xfe" ++
|
case.addError("\xff\xfe" ++
|
||||||
\\export fn foo() bool {
|
\\export fn foo() bool {
|
||||||
@ -185,7 +185,7 @@ pub fn addCases(ctx: *Cases, b: *std.Build) !void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
const case = ctx.obj("imported generic method call with invalid param", b.host);
|
const case = ctx.obj("imported generic method call with invalid param", b.graph.host);
|
||||||
|
|
||||||
case.addError(
|
case.addError(
|
||||||
\\pub const import = @import("import.zig");
|
\\pub const import = @import("import.zig");
|
||||||
|
@ -7,7 +7,7 @@ pub fn build(b: *std.Build) void {
|
|||||||
const exe = b.addExecutable(.{
|
const exe = b.addExecutable(.{
|
||||||
.name = "bss",
|
.name = "bss",
|
||||||
.root_source_file = b.path("main.zig"),
|
.root_source_file = b.path("main.zig"),
|
||||||
.target = b.host,
|
.target = b.graph.host,
|
||||||
.optimize = .Debug,
|
.optimize = .Debug,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.Optimize
|
|||||||
const lib_a = b.addStaticLibrary(.{
|
const lib_a = b.addStaticLibrary(.{
|
||||||
.name = "a",
|
.name = "a",
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
.target = b.host,
|
.target = b.graph.host,
|
||||||
});
|
});
|
||||||
lib_a.addCSourceFiles(.{
|
lib_a.addCSourceFiles(.{
|
||||||
.files = &.{ "c.c", "a.c", "b.c" },
|
.files = &.{ "c.c", "a.c", "b.c" },
|
||||||
|
@ -14,7 +14,7 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.Optimize
|
|||||||
const lib_a = b.addStaticLibrary(.{
|
const lib_a = b.addStaticLibrary(.{
|
||||||
.name = "a",
|
.name = "a",
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
.target = b.host,
|
.target = b.graph.host,
|
||||||
});
|
});
|
||||||
lib_a.addCSourceFiles(.{
|
lib_a.addCSourceFiles(.{
|
||||||
.files = &.{"a.c"},
|
.files = &.{"a.c"},
|
||||||
|
@ -14,7 +14,7 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.Optimize
|
|||||||
const lib_a = b.addStaticLibrary(.{
|
const lib_a = b.addStaticLibrary(.{
|
||||||
.name = "a",
|
.name = "a",
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
.target = b.host,
|
.target = b.graph.host,
|
||||||
});
|
});
|
||||||
lib_a.addCSourceFile(.{ .file = b.path("a.c"), .flags = &[_][]const u8{} });
|
lib_a.addCSourceFile(.{ .file = b.path("a.c"), .flags = &[_][]const u8{} });
|
||||||
lib_a.addIncludePath(b.path("."));
|
lib_a.addIncludePath(b.path("."));
|
||||||
@ -22,7 +22,7 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.Optimize
|
|||||||
const lib_b = b.addStaticLibrary(.{
|
const lib_b = b.addStaticLibrary(.{
|
||||||
.name = "b",
|
.name = "b",
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
.target = b.host,
|
.target = b.graph.host,
|
||||||
});
|
});
|
||||||
lib_b.addCSourceFile(.{ .file = b.path("b.c"), .flags = &[_][]const u8{} });
|
lib_b.addCSourceFile(.{ .file = b.path("b.c"), .flags = &[_][]const u8{} });
|
||||||
lib_b.addIncludePath(b.path("."));
|
lib_b.addIncludePath(b.path("."));
|
||||||
|
@ -83,14 +83,14 @@ pub fn testAll(b: *Build, build_opts: BuildOptions) *Step {
|
|||||||
|
|
||||||
// Tests requiring presence of macOS SDK in system path
|
// Tests requiring presence of macOS SDK in system path
|
||||||
if (build_opts.has_macos_sdk) {
|
if (build_opts.has_macos_sdk) {
|
||||||
macho_step.dependOn(testDeadStripDylibs(b, .{ .target = b.host }));
|
macho_step.dependOn(testDeadStripDylibs(b, .{ .target = b.graph.host }));
|
||||||
macho_step.dependOn(testHeaderpad(b, .{ .target = b.host }));
|
macho_step.dependOn(testHeaderpad(b, .{ .target = b.graph.host }));
|
||||||
macho_step.dependOn(testLinkDirectlyCppTbd(b, .{ .target = b.host }));
|
macho_step.dependOn(testLinkDirectlyCppTbd(b, .{ .target = b.graph.host }));
|
||||||
macho_step.dependOn(testMergeLiteralsObjc(b, .{ .target = b.host }));
|
macho_step.dependOn(testMergeLiteralsObjc(b, .{ .target = b.graph.host }));
|
||||||
macho_step.dependOn(testNeededFramework(b, .{ .target = b.host }));
|
macho_step.dependOn(testNeededFramework(b, .{ .target = b.graph.host }));
|
||||||
macho_step.dependOn(testObjc(b, .{ .target = b.host }));
|
macho_step.dependOn(testObjc(b, .{ .target = b.graph.host }));
|
||||||
macho_step.dependOn(testObjcpp(b, .{ .target = b.host }));
|
macho_step.dependOn(testObjcpp(b, .{ .target = b.graph.host }));
|
||||||
macho_step.dependOn(testWeakFramework(b, .{ .target = b.host }));
|
macho_step.dependOn(testWeakFramework(b, .{ .target = b.graph.host }));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ fn add(b: *Build, test_step: *Step, files: []const LazyPath, optimize: std.built
|
|||||||
.name = "test1",
|
.name = "test1",
|
||||||
.root_source_file = b.path("main.zig"),
|
.root_source_file = b.path("main.zig"),
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
.target = b.host,
|
.target = b.graph.host,
|
||||||
});
|
});
|
||||||
|
|
||||||
for (files) |file| {
|
for (files) |file| {
|
||||||
@ -77,12 +77,12 @@ fn add(b: *Build, test_step: *Step, files: []const LazyPath, optimize: std.built
|
|||||||
{
|
{
|
||||||
const lib_a = b.addStaticLibrary(.{
|
const lib_a = b.addStaticLibrary(.{
|
||||||
.name = "test2_a",
|
.name = "test2_a",
|
||||||
.target = b.host,
|
.target = b.graph.host,
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
});
|
});
|
||||||
const lib_b = b.addStaticLibrary(.{
|
const lib_b = b.addStaticLibrary(.{
|
||||||
.name = "test2_b",
|
.name = "test2_b",
|
||||||
.target = b.host,
|
.target = b.graph.host,
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -94,7 +94,7 @@ fn add(b: *Build, test_step: *Step, files: []const LazyPath, optimize: std.built
|
|||||||
const exe = b.addExecutable(.{
|
const exe = b.addExecutable(.{
|
||||||
.name = "test2",
|
.name = "test2",
|
||||||
.root_source_file = b.path("main.zig"),
|
.root_source_file = b.path("main.zig"),
|
||||||
.target = b.host,
|
.target = b.graph.host,
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
});
|
});
|
||||||
exe.linkLibrary(lib_a);
|
exe.linkLibrary(lib_a);
|
||||||
@ -111,19 +111,19 @@ fn add(b: *Build, test_step: *Step, files: []const LazyPath, optimize: std.built
|
|||||||
{
|
{
|
||||||
const lib_a = b.addStaticLibrary(.{
|
const lib_a = b.addStaticLibrary(.{
|
||||||
.name = "test3_a",
|
.name = "test3_a",
|
||||||
.target = b.host,
|
.target = b.graph.host,
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
});
|
});
|
||||||
const lib_b = b.addStaticLibrary(.{
|
const lib_b = b.addStaticLibrary(.{
|
||||||
.name = "test3_b",
|
.name = "test3_b",
|
||||||
.target = b.host,
|
.target = b.graph.host,
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
});
|
});
|
||||||
|
|
||||||
for (files, 1..) |file, i| {
|
for (files, 1..) |file, i| {
|
||||||
const obj = b.addObject(.{
|
const obj = b.addObject(.{
|
||||||
.name = b.fmt("obj_{}", .{i}),
|
.name = b.fmt("obj_{}", .{i}),
|
||||||
.target = b.host,
|
.target = b.graph.host,
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
});
|
});
|
||||||
obj.addCSourceFile(.{ .file = file, .flags = &flags });
|
obj.addCSourceFile(.{ .file = file, .flags = &flags });
|
||||||
@ -135,7 +135,7 @@ fn add(b: *Build, test_step: *Step, files: []const LazyPath, optimize: std.built
|
|||||||
const exe = b.addExecutable(.{
|
const exe = b.addExecutable(.{
|
||||||
.name = "test3",
|
.name = "test3",
|
||||||
.root_source_file = b.path("main.zig"),
|
.root_source_file = b.path("main.zig"),
|
||||||
.target = b.host,
|
.target = b.graph.host,
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
});
|
});
|
||||||
exe.linkLibrary(lib_a);
|
exe.linkLibrary(lib_a);
|
||||||
|
@ -96,7 +96,7 @@ pub fn addCase(self: *CompareOutput, case: TestCase) void {
|
|||||||
|
|
||||||
const exe = b.addExecutable(.{
|
const exe = b.addExecutable(.{
|
||||||
.name = "test",
|
.name = "test",
|
||||||
.target = b.host,
|
.target = b.graph.host,
|
||||||
.optimize = .Debug,
|
.optimize = .Debug,
|
||||||
});
|
});
|
||||||
exe.addAssemblyFile(write_src.files.items[0].getPath());
|
exe.addAssemblyFile(write_src.files.items[0].getPath());
|
||||||
@ -121,7 +121,7 @@ pub fn addCase(self: *CompareOutput, case: TestCase) void {
|
|||||||
.name = "test",
|
.name = "test",
|
||||||
.root_source_file = write_src.files.items[0].getPath(),
|
.root_source_file = write_src.files.items[0].getPath(),
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
.target = b.host,
|
.target = b.graph.host,
|
||||||
});
|
});
|
||||||
if (case.link_libc) {
|
if (case.link_libc) {
|
||||||
exe.linkSystemLibrary("c");
|
exe.linkSystemLibrary("c");
|
||||||
@ -146,7 +146,7 @@ pub fn addCase(self: *CompareOutput, case: TestCase) void {
|
|||||||
const exe = b.addExecutable(.{
|
const exe = b.addExecutable(.{
|
||||||
.name = "test",
|
.name = "test",
|
||||||
.root_source_file = write_src.files.items[0].getPath(),
|
.root_source_file = write_src.files.items[0].getPath(),
|
||||||
.target = b.host,
|
.target = b.graph.host,
|
||||||
.optimize = .Debug,
|
.optimize = .Debug,
|
||||||
});
|
});
|
||||||
if (case.link_libc) {
|
if (case.link_libc) {
|
||||||
|
@ -77,7 +77,7 @@ pub fn addCase(self: *RunTranslatedCContext, case: *const TestCase) void {
|
|||||||
}
|
}
|
||||||
const translate_c = b.addTranslateC(.{
|
const translate_c = b.addTranslateC(.{
|
||||||
.root_source_file = write_src.files.items[0].getPath(),
|
.root_source_file = write_src.files.items[0].getPath(),
|
||||||
.target = b.host,
|
.target = b.graph.host,
|
||||||
.optimize = .Debug,
|
.optimize = .Debug,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ fn addExpect(
|
|||||||
.name = "test",
|
.name = "test",
|
||||||
.root_source_file = write_src.files.items[0].getPath(),
|
.root_source_file = write_src.files.items[0].getPath(),
|
||||||
.optimize = optimize_mode,
|
.optimize = optimize_mode,
|
||||||
.target = b.host,
|
.target = b.graph.host,
|
||||||
.error_tracing = mode_config.error_tracing,
|
.error_tracing = mode_config.error_tracing,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ fn add(
|
|||||||
cpp_name: []const u8,
|
cpp_name: []const u8,
|
||||||
optimize: std.builtin.OptimizeMode,
|
optimize: std.builtin.OptimizeMode,
|
||||||
) void {
|
) void {
|
||||||
const target = b.host;
|
const target = b.graph.host;
|
||||||
|
|
||||||
const exe_c = b.addExecutable(.{
|
const exe_c = b.addExecutable(.{
|
||||||
.name = c_name,
|
.name = c_name,
|
||||||
|
@ -6,7 +6,7 @@ pub fn build(b: *std.Build) void {
|
|||||||
b.default_step = test_step;
|
b.default_step = test_step;
|
||||||
|
|
||||||
const optimize: std.builtin.OptimizeMode = .Debug;
|
const optimize: std.builtin.OptimizeMode = .Debug;
|
||||||
const target = b.host;
|
const target = b.graph.host;
|
||||||
|
|
||||||
if (builtin.os.tag == .wasi) return;
|
if (builtin.os.tag == .wasi) return;
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ pub fn build(b: *std.Build) void {
|
|||||||
const exe = b.addExecutable(.{
|
const exe = b.addExecutable(.{
|
||||||
.name = "test",
|
.name = "test",
|
||||||
.root_source_file = b.path("test.zig"),
|
.root_source_file = b.path("test.zig"),
|
||||||
.target = b.host,
|
.target = b.graph.host,
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
});
|
});
|
||||||
exe.root_module.addAnonymousImport("foo", .{
|
exe.root_module.addAnonymousImport("foo", .{
|
||||||
|
@ -18,7 +18,7 @@ pub fn build(b: *std.Build) void {
|
|||||||
const exe = b.addExecutable(.{
|
const exe = b.addExecutable(.{
|
||||||
.name = "test",
|
.name = "test",
|
||||||
.root_source_file = b.path("test.zig"),
|
.root_source_file = b.path("test.zig"),
|
||||||
.target = b.host,
|
.target = b.graph.host,
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
});
|
});
|
||||||
exe.root_module.addImport("foo", foo);
|
exe.root_module.addImport("foo", foo);
|
||||||
|
@ -14,7 +14,7 @@ pub fn build(b: *std.Build) void {
|
|||||||
const exe = b.addExecutable(.{
|
const exe = b.addExecutable(.{
|
||||||
.name = "test",
|
.name = "test",
|
||||||
.root_source_file = b.path("test.zig"),
|
.root_source_file = b.path("test.zig"),
|
||||||
.target = b.host,
|
.target = b.graph.host,
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
});
|
});
|
||||||
exe.root_module.addImport("foo", foo);
|
exe.root_module.addImport("foo", foo);
|
||||||
|
@ -9,7 +9,7 @@ pub fn build(b: *std.Build) void {
|
|||||||
const exe = b.addExecutable(.{
|
const exe = b.addExecutable(.{
|
||||||
.name = "test",
|
.name = "test",
|
||||||
.root_source_file = b.path("test.zig"),
|
.root_source_file = b.path("test.zig"),
|
||||||
.target = b.host,
|
.target = b.graph.host,
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
});
|
});
|
||||||
exe.root_module.addAnonymousImport("foo", .{
|
exe.root_module.addAnonymousImport("foo", .{
|
||||||
|
@ -13,7 +13,7 @@ pub fn build(b: *std.Build) void {
|
|||||||
const exe = b.addExecutable(.{
|
const exe = b.addExecutable(.{
|
||||||
.name = "test",
|
.name = "test",
|
||||||
.root_source_file = b.path("test.zig"),
|
.root_source_file = b.path("test.zig"),
|
||||||
.target = b.host,
|
.target = b.graph.host,
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
});
|
});
|
||||||
exe.root_module.addAnonymousImport("foo", .{
|
exe.root_module.addAnonymousImport("foo", .{
|
||||||
|
@ -15,7 +15,7 @@ pub fn build(b: *std.Build) void {
|
|||||||
const main = b.addExecutable(.{
|
const main = b.addExecutable(.{
|
||||||
.name = "main",
|
.name = "main",
|
||||||
.root_source_file = b.path("main.zig"),
|
.root_source_file = b.path("main.zig"),
|
||||||
.target = b.host,
|
.target = b.graph.host,
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
2
test/standalone/extern/build.zig
vendored
2
test/standalone/extern/build.zig
vendored
@ -6,7 +6,7 @@ pub fn build(b: *std.Build) void {
|
|||||||
const obj = b.addObject(.{
|
const obj = b.addObject(.{
|
||||||
.name = "exports",
|
.name = "exports",
|
||||||
.root_source_file = b.path("exports.zig"),
|
.root_source_file = b.path("exports.zig"),
|
||||||
.target = b.host,
|
.target = b.graph.host,
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
});
|
});
|
||||||
const main = b.addTest(.{
|
const main = b.addTest(.{
|
||||||
|
@ -5,7 +5,7 @@ pub fn build(b: *std.Build) void {
|
|||||||
b.default_step = test_step;
|
b.default_step = test_step;
|
||||||
|
|
||||||
const optimize: std.builtin.OptimizeMode = .Debug;
|
const optimize: std.builtin.OptimizeMode = .Debug;
|
||||||
const target = b.host;
|
const target = b.graph.host;
|
||||||
|
|
||||||
const obj1 = b.addStaticLibrary(.{
|
const obj1 = b.addStaticLibrary(.{
|
||||||
.name = "obj1",
|
.name = "obj1",
|
||||||
|
@ -6,7 +6,7 @@ pub fn build(b: *std.Build) void {
|
|||||||
b.default_step = test_step;
|
b.default_step = test_step;
|
||||||
|
|
||||||
const optimize: std.builtin.OptimizeMode = .Debug;
|
const optimize: std.builtin.OptimizeMode = .Debug;
|
||||||
const target = b.host;
|
const target = b.graph.host;
|
||||||
|
|
||||||
if (builtin.os.tag == .windows) {
|
if (builtin.os.tag == .windows) {
|
||||||
// https://github.com/ziglang/zig/issues/12419
|
// https://github.com/ziglang/zig/issues/12419
|
||||||
|
@ -10,7 +10,7 @@ pub fn build(b: *std.Build) void {
|
|||||||
.name = "main",
|
.name = "main",
|
||||||
.root_source_file = b.path("main.zig"),
|
.root_source_file = b.path("main.zig"),
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
.target = b.host,
|
.target = b.graph.host,
|
||||||
});
|
});
|
||||||
_ = obj.getEmittedLlvmIr();
|
_ = obj.getEmittedLlvmIr();
|
||||||
_ = obj.getEmittedLlvmBc();
|
_ = obj.getEmittedLlvmBc();
|
||||||
|
@ -6,7 +6,7 @@ pub fn build(b: *std.Build) void {
|
|||||||
b.default_step = test_step;
|
b.default_step = test_step;
|
||||||
|
|
||||||
const optimize: std.builtin.OptimizeMode = .Debug;
|
const optimize: std.builtin.OptimizeMode = .Debug;
|
||||||
const target = b.host;
|
const target = b.graph.host;
|
||||||
|
|
||||||
const exe = b.addExecutable(.{
|
const exe = b.addExecutable(.{
|
||||||
.name = "main",
|
.name = "main",
|
||||||
|
@ -5,7 +5,7 @@ pub fn build(b: *std.Build) void {
|
|||||||
b.default_step = test_step;
|
b.default_step = test_step;
|
||||||
|
|
||||||
const optimize: std.builtin.OptimizeMode = .Debug;
|
const optimize: std.builtin.OptimizeMode = .Debug;
|
||||||
const target = b.host;
|
const target = b.graph.host;
|
||||||
|
|
||||||
const obj = b.addObject(.{
|
const obj = b.addObject(.{
|
||||||
.name = "test",
|
.name = "test",
|
||||||
|
@ -6,7 +6,7 @@ pub fn build(b: *std.Build) void {
|
|||||||
b.default_step = test_step;
|
b.default_step = test_step;
|
||||||
|
|
||||||
const optimize: std.builtin.OptimizeMode = .Debug;
|
const optimize: std.builtin.OptimizeMode = .Debug;
|
||||||
const target = b.host;
|
const target = b.graph.host;
|
||||||
|
|
||||||
if (builtin.os.tag == .wasi) return;
|
if (builtin.os.tag == .wasi) return;
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.Optimize
|
|||||||
const exe = b.addExecutable(.{
|
const exe = b.addExecutable(.{
|
||||||
.name = "test",
|
.name = "test",
|
||||||
.root_source_file = b.path("main.zig"),
|
.root_source_file = b.path("main.zig"),
|
||||||
.target = b.host,
|
.target = b.graph.host,
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
});
|
});
|
||||||
exe.addCSourceFile(.{ .file = b.path("test.c"), .flags = &[_][]const u8{"-std=c11"} });
|
exe.addCSourceFile(.{ .file = b.path("test.c"), .flags = &[_][]const u8{"-std=c11"} });
|
||||||
|
@ -5,7 +5,7 @@ pub fn build(b: *std.Build) void {
|
|||||||
b.default_step = test_step;
|
b.default_step = test_step;
|
||||||
|
|
||||||
const optimize: std.builtin.OptimizeMode = .Debug;
|
const optimize: std.builtin.OptimizeMode = .Debug;
|
||||||
const target = b.host;
|
const target = b.graph.host;
|
||||||
|
|
||||||
const obj = b.addObject(.{
|
const obj = b.addObject(.{
|
||||||
.name = "base64",
|
.name = "base64",
|
||||||
|
@ -3,7 +3,7 @@ const std = @import("std");
|
|||||||
pub fn build(b: *std.Build) void {
|
pub fn build(b: *std.Build) void {
|
||||||
const main = b.addTest(.{
|
const main = b.addTest(.{
|
||||||
.root_source_file = b.path("src/main.zig"),
|
.root_source_file = b.path("src/main.zig"),
|
||||||
.target = b.host,
|
.target = b.graph.host,
|
||||||
.optimize = .Debug,
|
.optimize = .Debug,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ pub fn build(b: *std.Build) void {
|
|||||||
.name = "test",
|
.name = "test",
|
||||||
.root_source_file = b.path("test.zig"),
|
.root_source_file = b.path("test.zig"),
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
.target = b.host,
|
.target = b.graph.host,
|
||||||
});
|
});
|
||||||
exe.root_module.addAnonymousImport("my_pkg", .{ .root_source_file = b.path("pkg.zig") });
|
exe.root_module.addAnonymousImport("my_pkg", .{ .root_source_file = b.path("pkg.zig") });
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ pub fn build(b: *std.Build) void {
|
|||||||
b.default_step = test_step;
|
b.default_step = test_step;
|
||||||
|
|
||||||
const optimize: std.builtin.OptimizeMode = .Debug;
|
const optimize: std.builtin.OptimizeMode = .Debug;
|
||||||
const target = b.host;
|
const target = b.graph.host;
|
||||||
|
|
||||||
// The test requires getFdPath in order to to get the path of the
|
// The test requires getFdPath in order to to get the path of the
|
||||||
// File returned by openSelfExe
|
// File returned by openSelfExe
|
||||||
|
@ -10,7 +10,7 @@ pub fn build(b: *std.Build) void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const optimize: std.builtin.OptimizeMode = .Debug;
|
const optimize: std.builtin.OptimizeMode = .Debug;
|
||||||
const target = b.host;
|
const target = b.graph.host;
|
||||||
const lib = b.addSharedLibrary(.{
|
const lib = b.addSharedLibrary(.{
|
||||||
.name = "mathtest",
|
.name = "mathtest",
|
||||||
.root_source_file = b.path("mathtest.zig"),
|
.root_source_file = b.path("mathtest.zig"),
|
||||||
|
@ -9,7 +9,7 @@ pub fn build(b: *std.Build) void {
|
|||||||
const foo = b.addStaticLibrary(.{
|
const foo = b.addStaticLibrary(.{
|
||||||
.name = "foo",
|
.name = "foo",
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
.target = b.host,
|
.target = b.graph.host,
|
||||||
});
|
});
|
||||||
foo.addCSourceFile(.{ .file = b.path("foo.c"), .flags = &[_][]const u8{} });
|
foo.addCSourceFile(.{ .file = b.path("foo.c"), .flags = &[_][]const u8{} });
|
||||||
foo.addIncludePath(b.path("."));
|
foo.addIncludePath(b.path("."));
|
||||||
|
@ -5,7 +5,7 @@ pub fn build(b: *std.Build) void {
|
|||||||
b.default_step = test_step;
|
b.default_step = test_step;
|
||||||
|
|
||||||
const optimize = std.builtin.OptimizeMode.Debug;
|
const optimize = std.builtin.OptimizeMode.Debug;
|
||||||
const target = b.host;
|
const target = b.graph.host;
|
||||||
|
|
||||||
const main = b.addExecutable(.{
|
const main = b.addExecutable(.{
|
||||||
.name = "main",
|
.name = "main",
|
||||||
|
@ -35,7 +35,7 @@ pub fn build(b: *std.Build) !void {
|
|||||||
const fuzz = b.addExecutable(.{
|
const fuzz = b.addExecutable(.{
|
||||||
.name = "fuzz",
|
.name = "fuzz",
|
||||||
.root_source_file = b.path("fuzz.zig"),
|
.root_source_file = b.path("fuzz.zig"),
|
||||||
.target = b.host,
|
.target = b.graph.host,
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ pub fn build(b: *std.Build) !void {
|
|||||||
b.default_step = test_step;
|
b.default_step = test_step;
|
||||||
|
|
||||||
const optimize: std.builtin.OptimizeMode = .Debug;
|
const optimize: std.builtin.OptimizeMode = .Debug;
|
||||||
const target = b.host;
|
const target = b.graph.host;
|
||||||
|
|
||||||
if (builtin.os.tag != .windows) return;
|
if (builtin.os.tag != .windows) return;
|
||||||
|
|
||||||
|
@ -12,10 +12,10 @@ pub fn build(b: *std.Build) void {
|
|||||||
|
|
||||||
const generated_h_step = b.addWriteFile("generated.h", "#define GENERATED_DEFINE \"foo\"");
|
const generated_h_step = b.addWriteFile("generated.h", "#define GENERATED_DEFINE \"foo\"");
|
||||||
|
|
||||||
add(b, b.host, .any, test_step, generated_h_step);
|
add(b, b.graph.host, .any, test_step, generated_h_step);
|
||||||
add(b, target, .any, test_step, generated_h_step);
|
add(b, target, .any, test_step, generated_h_step);
|
||||||
|
|
||||||
add(b, b.host, .gnu, test_step, generated_h_step);
|
add(b, b.graph.host, .gnu, test_step, generated_h_step);
|
||||||
add(b, target, .gnu, test_step, generated_h_step);
|
add(b, target, .gnu, test_step, generated_h_step);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ pub fn build(b: *std.Build) void {
|
|||||||
b.default_step = test_step;
|
b.default_step = test_step;
|
||||||
|
|
||||||
const optimize: std.builtin.OptimizeMode = .Debug;
|
const optimize: std.builtin.OptimizeMode = .Debug;
|
||||||
const target = b.host;
|
const target = b.graph.host;
|
||||||
|
|
||||||
if (builtin.os.tag != .windows) return;
|
if (builtin.os.tag != .windows) return;
|
||||||
|
|
||||||
|
@ -658,7 +658,7 @@ pub fn addStackTraceTests(
|
|||||||
const check_exe = b.addExecutable(.{
|
const check_exe = b.addExecutable(.{
|
||||||
.name = "check-stack-trace",
|
.name = "check-stack-trace",
|
||||||
.root_source_file = b.path("test/src/check-stack-trace.zig"),
|
.root_source_file = b.path("test/src/check-stack-trace.zig"),
|
||||||
.target = b.host,
|
.target = b.graph.host,
|
||||||
.optimize = .Debug,
|
.optimize = .Debug,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user