mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
CLI: delete redundant logic and use null instead of undef
The `null` value here was missed in 0a4d4eb252a73555a568a532902951a13284d2ef. I hope it is the cause of the CI failures on Windows. The fact that libc++ depends on libc is not important for the CLI and Compilation.create already handles that logic.
This commit is contained in:
parent
d7e74f7cbf
commit
469af67804
1 changed files with 2 additions and 14 deletions
16
src/main.zig
16
src/main.zig
|
|
@ -1151,9 +1151,6 @@ fn buildOutputType(
|
||||||
try system_libs.put(args_iter.nextOrFatal(), .{
|
try system_libs.put(args_iter.nextOrFatal(), .{
|
||||||
.needed = false,
|
.needed = false,
|
||||||
.weak = false,
|
.weak = false,
|
||||||
// -l always dynamic links. For static libraries,
|
|
||||||
// users are expected to use positional arguments
|
|
||||||
// which are always unambiguous.
|
|
||||||
.preferred_mode = lib_preferred_mode,
|
.preferred_mode = lib_preferred_mode,
|
||||||
.search_strategy = lib_search_strategy,
|
.search_strategy = lib_search_strategy,
|
||||||
});
|
});
|
||||||
|
|
@ -1560,9 +1557,6 @@ fn buildOutputType(
|
||||||
try system_libs.put(arg["-l".len..], .{
|
try system_libs.put(arg["-l".len..], .{
|
||||||
.needed = false,
|
.needed = false,
|
||||||
.weak = false,
|
.weak = false,
|
||||||
// -l always dynamic links. For static libraries,
|
|
||||||
// users are expected to use positional arguments
|
|
||||||
// which are always unambiguous.
|
|
||||||
.preferred_mode = lib_preferred_mode,
|
.preferred_mode = lib_preferred_mode,
|
||||||
.search_strategy = lib_search_strategy,
|
.search_strategy = lib_search_strategy,
|
||||||
});
|
});
|
||||||
|
|
@ -2675,7 +2669,7 @@ fn buildOutputType(
|
||||||
.lib = .{
|
.lib = .{
|
||||||
.needed = true,
|
.needed = true,
|
||||||
.weak = false,
|
.weak = false,
|
||||||
.path = undefined,
|
.path = null,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -2700,11 +2694,6 @@ fn buildOutputType(
|
||||||
}
|
}
|
||||||
// After this point, external_system_libs is used instead of system_libs.
|
// After this point, external_system_libs is used instead of system_libs.
|
||||||
|
|
||||||
// libc++ depends on libc
|
|
||||||
if (link_libcpp) {
|
|
||||||
link_libc = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Trigger native system library path detection if necessary.
|
// Trigger native system library path detection if necessary.
|
||||||
if (sysroot == null and cross_target.isNativeOs() and
|
if (sysroot == null and cross_target.isNativeOs() and
|
||||||
(external_system_libs.len != 0 or want_native_include_dirs))
|
(external_system_libs.len != 0 or want_native_include_dirs))
|
||||||
|
|
@ -6343,13 +6332,12 @@ fn accessLibPath(
|
||||||
// In the case of Darwin, the main check will be .dylib, so here we
|
// In the case of Darwin, the main check will be .dylib, so here we
|
||||||
// additionally check for .so files.
|
// additionally check for .so files.
|
||||||
if (target.isDarwin() and link_mode == .Dynamic) so: {
|
if (target.isDarwin() and link_mode == .Dynamic) so: {
|
||||||
// Prefer .tbd over .dylib.
|
|
||||||
test_path.clearRetainingCapacity();
|
test_path.clearRetainingCapacity();
|
||||||
try test_path.writer().print("{s}" ++ sep ++ "lib{s}.so", .{ lib_dir_path, lib_name });
|
try test_path.writer().print("{s}" ++ sep ++ "lib{s}.so", .{ lib_dir_path, lib_name });
|
||||||
try checked_paths.writer().print("\n {s}", .{test_path.items});
|
try checked_paths.writer().print("\n {s}", .{test_path.items});
|
||||||
fs.cwd().access(test_path.items, .{}) catch |err| switch (err) {
|
fs.cwd().access(test_path.items, .{}) catch |err| switch (err) {
|
||||||
error.FileNotFound => break :so,
|
error.FileNotFound => break :so,
|
||||||
else => |e| fatal("unable to search for tbd library '{s}': {s}", .{
|
else => |e| fatal("unable to search for so library '{s}': {s}", .{
|
||||||
test_path.items, @errorName(e),
|
test_path.items, @errorName(e),
|
||||||
}),
|
}),
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue