diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2023-03-07 00:44:10 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2023-03-15 10:48:14 -0700 |
| commit | 4efeeaac881c5583321e8b385e90f004e99bc3d1 (patch) | |
| tree | 8b2abe47efb8fa7d68d44764f366543030b1118a /test/link/static_lib_as_system_lib/build.zig | |
| parent | e122cd6312606068eb14987ed4d7527341484d26 (diff) | |
| download | zig-4efeeaac881c5583321e8b385e90f004e99bc3d1.tar.gz zig-4efeeaac881c5583321e8b385e90f004e99bc3d1.zip | |
delete link test "static_lib_as_system_lib"
I disagree with this behavior and will be reverting the changes
corresponding to this test case.
Also this test case unnecessarily uses a .c file when a .zig file would
be preferred, and has a problematic dependency on the install step,
preventing this test case from playing nicely with the cache.
Diffstat (limited to 'test/link/static_lib_as_system_lib/build.zig')
| -rw-r--r-- | test/link/static_lib_as_system_lib/build.zig | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/test/link/static_lib_as_system_lib/build.zig b/test/link/static_lib_as_system_lib/build.zig deleted file mode 100644 index 1957d2e134..0000000000 --- a/test/link/static_lib_as_system_lib/build.zig +++ /dev/null @@ -1,34 +0,0 @@ -const std = @import("std"); - -pub fn build(b: *std.Build) void { - const test_step = b.step("test", "Test it"); - b.default_step = test_step; - - add(b, test_step, .Debug); - add(b, test_step, .ReleaseFast); - add(b, test_step, .ReleaseSmall); - add(b, test_step, .ReleaseSafe); -} - -fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.OptimizeMode) void { - const lib_a = b.addStaticLibrary(.{ - .name = "a", - .optimize = optimize, - .target = .{}, - }); - lib_a.addCSourceFile("a.c", &[_][]const u8{}); - lib_a.addIncludePath("."); - lib_a.install(); - - const test_exe = b.addTest(.{ - .root_source_file = .{ .path = "main.zig" }, - .optimize = optimize, - .target = .{}, - }); - test_exe.linkSystemLibrary("a"); // force linking liba.a as -la - test_exe.addSystemIncludePath("."); - const search_path = std.fs.path.join(b.allocator, &[_][]const u8{ b.install_path, "lib" }) catch @panic("OOM"); - test_exe.addLibraryPath(search_path); - - test_step.dependOn(&test_exe.step); -} |
