mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-03-13 21:26:16 +01:00
CLI: infer --name based on first C source file or object
Previously, --name would only be inferred if there was exactly 1 C source file or exactly 1 object. Now it will be inferred if there is at least one of either.
This commit is contained in:
parent
97692cb4fe
commit
b4c0396d3c
1 changed files with 2 additions and 2 deletions
|
|
@ -1311,10 +1311,10 @@ fn buildOutputType(
|
|||
} else if (root_src_file) |file| {
|
||||
const basename = fs.path.basename(file);
|
||||
break :blk mem.split(basename, ".").next().?;
|
||||
} else if (c_source_files.items.len == 1) {
|
||||
} else if (c_source_files.items.len >= 1) {
|
||||
const basename = fs.path.basename(c_source_files.items[0].src_path);
|
||||
break :blk mem.split(basename, ".").next().?;
|
||||
} else if (link_objects.items.len == 1) {
|
||||
} else if (link_objects.items.len >= 1) {
|
||||
const basename = fs.path.basename(link_objects.items[0]);
|
||||
break :blk mem.split(basename, ".").next().?;
|
||||
} else if (emit_bin == .yes) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue