diff options
| author | Ryan Liptak <squeek502@hotmail.com> | 2023-10-18 18:12:22 -0700 |
|---|---|---|
| committer | Ryan Liptak <squeek502@hotmail.com> | 2023-10-18 18:30:32 -0700 |
| commit | 8ec04b567e3f37b82b870b6c595419905cbfcafd (patch) | |
| tree | 51436e9d92d51a73fc6997ec74c5b3e1e6b4f535 /src/Compilation.zig | |
| parent | 81a61c8ecd7a970dc96a6068cf8587fd81ebd6e4 (diff) | |
| download | zig-8ec04b567e3f37b82b870b6c595419905cbfcafd.tar.gz zig-8ec04b567e3f37b82b870b6c595419905cbfcafd.zip | |
Error if an .rc file uses the 'preprocess only' or 'no preprocess' flags
Diffstat (limited to 'src/Compilation.zig')
| -rw-r--r-- | src/Compilation.zig | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig index 5f9448c50f..6d32876384 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -4759,11 +4759,17 @@ fn updateWin32Resource(comp: *Compilation, win32_resource: *Win32Resource, win32 // 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, .{ |
