mirror of
https://github.com/ziglang/zig.git
synced 2026-02-20 00:08:56 +00:00
Error if an .rc file uses the 'preprocess only' or 'no preprocess' flags
This commit is contained in:
parent
81a61c8ecd
commit
8ec04b567e
@ -243,6 +243,8 @@ pub const RcSourceFile = struct {
|
||||
file: LazyPath,
|
||||
/// Any option that rc.exe accepts will work here, with the exception of:
|
||||
/// - `/fo`: The output filename is set by the build system
|
||||
/// - `/p`: Only running the preprocessor is not supported in this context
|
||||
/// - `/:no-preprocess` (non-standard option): Not supported in this context
|
||||
/// - Any MUI-related option
|
||||
/// https://learn.microsoft.com/en-us/windows/win32/menurc/using-rc-the-rc-command-line-
|
||||
///
|
||||
|
||||
@ -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, .{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user