diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2023-10-20 03:49:14 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-10-20 03:49:14 -0400 |
| commit | a361f37b1c247a8a05383ceee48d0e2885f5bcd8 (patch) | |
| tree | b33c046798d2329332f955a83375df93b7de2afd /src/Compilation.zig | |
| parent | db18b562acd7d7dd3a35880aabee3b1c34fb043a (diff) | |
| parent | 8ec04b567e3f37b82b870b6c595419905cbfcafd (diff) | |
| download | zig-a361f37b1c247a8a05383ceee48d0e2885f5bcd8.tar.gz zig-a361f37b1c247a8a05383ceee48d0e2885f5bcd8.zip | |
Merge pull request #17608 from squeek502/resinator-fixes
resinator: Fix `INCLUDE` var handling and sync with upstream
Diffstat (limited to 'src/Compilation.zig')
| -rw-r--r-- | src/Compilation.zig | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig index 596e555411..e15ade5d5b 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -4766,11 +4766,21 @@ fn updateWin32Resource(comp: *Compilation, win32_resource: *Win32Resource, win32 }; defer options.deinit(); + // We never want to read the INCLUDE environment variable, so + // unconditionally set `ignore_include_env_var` to true + options.ignore_include_env_var = true; + + if (options.preprocess != .yes) { + return comp.failWin32Resource(win32_resource, "the '{s}' option is not supported in this context", .{switch (options.preprocess) { + .no => "/:no-preprocess", + .only => "/p", + .yes => unreachable, + }}); + } + var argv = std.ArrayList([]const u8).init(comp.gpa); defer argv.deinit(); - // TODO: support options.preprocess == .no and .only - // alternatively, error if those options are used try argv.appendSlice(&[_][]const u8{ self_exe_path, "clang" }); try resinator.preprocess.appendClangArgs(arena, &argv, options, .{ |
