diff options
| author | mlugg <mlugg@mlugg.co.uk> | 2024-12-16 22:26:34 +0000 |
|---|---|---|
| committer | Eric Joldasov <bratishkaerik@landless-city.net> | 2024-12-18 01:49:13 +0500 |
| commit | 6bd590ad37dcb7e46c8eb78c54e69ad07e5b565e (patch) | |
| tree | 512a9e21385bff95e3357ebad25d67a7d4503076 /test/standalone/stack_iterator/build.zig | |
| parent | 82659c4594d12e5b80d2684320e15ce93eedb966 (diff) | |
| download | zig-6bd590ad37dcb7e46c8eb78c54e69ad07e5b565e.tar.gz zig-6bd590ad37dcb7e46c8eb78c54e69ad07e5b565e.zip | |
test-standalone: migrate from deprecated std.Build APIs
Diffstat (limited to 'test/standalone/stack_iterator/build.zig')
| -rw-r--r-- | test/standalone/stack_iterator/build.zig | 65 |
1 files changed, 38 insertions, 27 deletions
diff --git a/test/standalone/stack_iterator/build.zig b/test/standalone/stack_iterator/build.zig index 20027428b0..9d660b5c57 100644 --- a/test/standalone/stack_iterator/build.zig +++ b/test/standalone/stack_iterator/build.zig @@ -20,11 +20,13 @@ pub fn build(b: *std.Build) void { { const exe = b.addExecutable(.{ .name = "unwind_fp", - .root_source_file = b.path("unwind.zig"), - .target = target, - .optimize = optimize, - .unwind_tables = if (target.result.isDarwin()) .@"async" else null, - .omit_frame_pointer = false, + .root_module = b.createModule(.{ + .root_source_file = b.path("unwind.zig"), + .target = target, + .optimize = optimize, + .unwind_tables = if (target.result.isDarwin()) .@"async" else null, + .omit_frame_pointer = false, + }), }); const run_cmd = b.addRunArtifact(exe); @@ -43,11 +45,13 @@ pub fn build(b: *std.Build) void { { const exe = b.addExecutable(.{ .name = "unwind_nofp", - .root_source_file = b.path("unwind.zig"), - .target = target, - .optimize = optimize, - .unwind_tables = .@"async", - .omit_frame_pointer = true, + .root_module = b.createModule(.{ + .root_source_file = b.path("unwind.zig"), + .target = target, + .optimize = optimize, + .unwind_tables = .@"async", + .omit_frame_pointer = true, + }), }); const run_cmd = b.addRunArtifact(exe); @@ -66,27 +70,32 @@ pub fn build(b: *std.Build) void { { const c_shared_lib = b.addSharedLibrary(.{ .name = "c_shared_lib", - .target = target, - .optimize = optimize, - .strip = false, + .root_module = b.createModule(.{ + .root_source_file = null, + .target = target, + .optimize = optimize, + .link_libc = true, + .strip = false, + }), }); if (target.result.os.tag == .windows) c_shared_lib.root_module.addCMacro("LIB_API", "__declspec(dllexport)"); - c_shared_lib.addCSourceFile(.{ + c_shared_lib.root_module.addCSourceFile(.{ .file = b.path("shared_lib.c"), .flags = &.{"-fomit-frame-pointer"}, }); - c_shared_lib.linkLibC(); const exe = b.addExecutable(.{ .name = "shared_lib_unwind", - .root_source_file = b.path("shared_lib_unwind.zig"), - .target = target, - .optimize = optimize, - .unwind_tables = if (target.result.isDarwin()) .@"async" else null, - .omit_frame_pointer = true, + .root_module = b.createModule(.{ + .root_source_file = b.path("shared_lib_unwind.zig"), + .target = target, + .optimize = optimize, + .unwind_tables = if (target.result.isDarwin()) .@"async" else null, + .omit_frame_pointer = true, + }), }); exe.linkLibrary(c_shared_lib); @@ -117,14 +126,16 @@ pub fn build(b: *std.Build) void { inline for (no_os_targets) |os_tag| { const exe = b.addExecutable(.{ .name = "unwind_freestanding", - .root_source_file = b.path("unwind_freestanding.zig"), - .target = b.resolveTargetQuery(.{ - .cpu_arch = .x86_64, - .os_tag = os_tag, + .root_module = b.createModule(.{ + .root_source_file = b.path("unwind_freestanding.zig"), + .target = b.resolveTargetQuery(.{ + .cpu_arch = .x86_64, + .os_tag = os_tag, + }), + .optimize = optimize, + .unwind_tables = null, + .omit_frame_pointer = false, }), - .optimize = optimize, - .unwind_tables = null, - .omit_frame_pointer = false, }); // This "freestanding" binary is runnable because it invokes the |
