| ... | @@ -2721,7 +2721,7 @@ fn buildOutputType( | ... | @@ -2721,7 +2721,7 @@ fn buildOutputType( |
| 2721 | }, | 2721 | }, |
| 2722 | } | 2722 | } |
| 2723 | if (create_module.c_source_files.items.len == 0 and | 2723 | if (create_module.c_source_files.items.len == 0 and |
| 2724 | !link.anyObjectInputs(create_module.link_inputs.items) and | 2724 | !anyObjectLinkInputs(create_module.cli_link_inputs.items) and |
| 2725 | root_src_file == null) | 2725 | root_src_file == null) |
| 2726 | { | 2726 | { |
| 2727 | // For example `zig cc` and no args should print the "no input files" message. | 2727 | // For example `zig cc` and no args should print the "no input files" message. |
| ... | @@ -2763,9 +2763,13 @@ fn buildOutputType( | ... | @@ -2763,9 +2763,13 @@ fn buildOutputType( |
| 2763 | if (create_module.c_source_files.items.len >= 1) | 2763 | if (create_module.c_source_files.items.len >= 1) |
| 2764 | break :b create_module.c_source_files.items[0].src_path; | 2764 | break :b create_module.c_source_files.items[0].src_path; |
| 2765 | | 2765 | |
| 2766 | for (create_module.link_inputs.items) |link_input| { | 2766 | for (create_module.cli_link_inputs.items) |unresolved_link_input| switch (unresolved_link_input) { |
| 2767 | if (link_input.path()) |path| break :b path.sub_path; | 2767 | .path_query => |pq| switch (Compilation.classifyFileExt(pq.path.sub_path)) { |
| 2768 | } | 2768 | .object, .static_library, .res => break :b pq.path.sub_path, |
| | 2769 | else => continue, |
| | 2770 | }, |
| | 2771 | else => continue, |
| | 2772 | }; |
| 2769 | | 2773 | |
| 2770 | if (emit_bin == .yes) | 2774 | if (emit_bin == .yes) |
| 2771 | break :b emit_bin.yes; | 2775 | break :b emit_bin.yes; |
| ... | @@ -7491,3 +7495,14 @@ fn handleModArg( | ... | @@ -7491,3 +7495,14 @@ fn handleModArg( |
| 7491 | c_source_files_owner_index.* = create_module.c_source_files.items.len; | 7495 | c_source_files_owner_index.* = create_module.c_source_files.items.len; |
| 7492 | rc_source_files_owner_index.* = create_module.rc_source_files.items.len; | 7496 | rc_source_files_owner_index.* = create_module.rc_source_files.items.len; |
| 7493 | } | 7497 | } |
| | 7498 | |
| | 7499 | fn anyObjectLinkInputs(link_inputs: []const link.UnresolvedInput) bool { |
| | 7500 | for (link_inputs) |link_input| switch (link_input) { |
| | 7501 | .path_query => |pq| switch (Compilation.classifyFileExt(pq.path.sub_path)) { |
| | 7502 | .object, .static_library, .res => return true, |
| | 7503 | else => continue, |
| | 7504 | }, |
| | 7505 | else => continue, |
| | 7506 | }; |
| | 7507 | return false; |
| | 7508 | } |