Skip to content

Commit cb896a6

Browse files
committed
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.
1 parent 4c51ade commit cb896a6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1340,10 +1340,10 @@ fn buildOutputType(
13401340
} else if (root_src_file) |file| {
13411341
const basename = fs.path.basename(file);
13421342
break :blk mem.split(basename, ".").next().?;
1343-
} else if (c_source_files.items.len == 1) {
1343+
} else if (c_source_files.items.len >= 1) {
13441344
const basename = fs.path.basename(c_source_files.items[0].src_path);
13451345
break :blk mem.split(basename, ".").next().?;
1346-
} else if (link_objects.items.len == 1) {
1346+
} else if (link_objects.items.len >= 1) {
13471347
const basename = fs.path.basename(link_objects.items[0]);
13481348
break :blk mem.split(basename, ".").next().?;
13491349
} else if (emit_bin == .yes) {

0 commit comments

Comments
 (0)