diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2023-12-27 23:47:31 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2024-01-01 19:49:08 -0700 |
| commit | 659e043a34e1b5b24cb83ce5569d7ee295eb27ad (patch) | |
| tree | 232676e649d91a4ec37b92fb0b2faeb79c19b47a /src/Compilation.zig | |
| parent | 3a0b76b855b243867d84d8bfa5de550143bed2ae (diff) | |
| download | zig-659e043a34e1b5b24cb83ce5569d7ee295eb27ad.tar.gz zig-659e043a34e1b5b24cb83ce5569d7ee295eb27ad.zip | |
Compilation: don't add importlib jobs when outputting C code
Fixes "building import libs not included in core functionality" when
bootstrapping on Windows.
Diffstat (limited to 'src/Compilation.zig')
| -rw-r--r-- | src/Compilation.zig | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig index cb47a5d88a..7ff5801e46 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -3580,6 +3580,9 @@ fn processOneJob(comp: *Compilation, job: Job, prog_node: *std.Progress.Node) !v }; }, .windows_import_lib => |index| { + if (build_options.only_c) + @panic("building import libs not included in core functionality"); + const named_frame = tracy.namedFrame("windows_import_lib"); defer named_frame.end(); @@ -6391,15 +6394,18 @@ pub fn addLinkLib(comp: *Compilation, lib_name: []const u8) !void { // If we haven't seen this library yet and we're targeting Windows, we need // to queue up a work item to produce the DLL import library for this. const gop = try comp.system_libs.getOrPut(comp.gpa, lib_name); - if (!gop.found_existing and comp.getTarget().os.tag == .windows) { + if (!gop.found_existing) { gop.value_ptr.* = .{ .needed = true, .weak = false, .path = null, }; - try comp.work_queue.writeItem(.{ - .windows_import_lib = comp.system_libs.count() - 1, - }); + const target = comp.root_mod.resolved_target.result; + if (target.os.tag == .windows and target.ofmt != .c) { + try comp.work_queue.writeItem(.{ + .windows_import_lib = comp.system_libs.count() - 1, + }); + } } } |
