authorgravatar for squeek502@hotmail.comRyan Liptak <squeek502@hotmail.com> 2025-11-07 19:16:52-08:00
committergravatar for squeek502@hotmail.comRyan Liptak <squeek502@hotmail.com> 2025-11-07 19:16:52-08:00
logda77d306b637f9ecd4ad4657978b22063c9ecf1d
tree7d40eefbea9795a44df07e280fa3b1c7452bab42
parentf587209e04f93ac36fdd2e4b4f831e87b240f9ae

Move/coalesce RcIncludes enum to `std.zig.RcIncludes`


4 files changed, 17 insertions(+), 18 deletions(-)

lib/std/Build/Step/Compile.zig+1-2
...@@ -66,13 +66,12 @@ installed_headers: std.array_list.Managed(HeaderInstallation),...@@ -66,13 +66,12 @@ installed_headers: std.array_list.Managed(HeaderInstallation),
66/// created otherwise.66/// created otherwise.
67installed_headers_include_tree: ?*Step.WriteFile = null,67installed_headers_include_tree: ?*Step.WriteFile = null,
6868
69// keep in sync with src/Compilation.zig:RcIncludes
70/// Behavior of automatic detection of include directories when compiling .rc files.69/// Behavior of automatic detection of include directories when compiling .rc files.
71/// any: Use MSVC if available, fall back to MinGW.70/// any: Use MSVC if available, fall back to MinGW.
72/// msvc: Use MSVC include paths (must be present on the system).71/// msvc: Use MSVC include paths (must be present on the system).
73/// gnu: Use MinGW include paths (distributed with Zig).72/// gnu: Use MinGW include paths (distributed with Zig).
74/// none: Do not use any autodetected include paths.73/// none: Do not use any autodetected include paths.
75rc_includes: enum { any, msvc, gnu, none } = .any,74rc_includes: std.zig.RcIncludes = .any,
7675
77/// (Windows) .manifest file to embed in the compilation76/// (Windows) .manifest file to embed in the compilation
78/// Set via options; intended to be read-only after that.77/// Set via options; intended to be read-only after that.
lib/std/zig.zig+11
...@@ -379,6 +379,17 @@ pub const Subsystem = enum {...@@ -379,6 +379,17 @@ pub const Subsystem = enum {
379379
380pub const CompressDebugSections = enum { none, zlib, zstd };380pub const CompressDebugSections = enum { none, zlib, zstd };
381381
382pub const RcIncludes = enum {
383 /// Use MSVC if available, fall back to MinGW.
384 any,
385 /// Use MSVC include paths (MSVC install + Windows SDK, must be present on the system).
386 msvc,
387 /// Use MinGW include paths (distributed with Zig).
388 gnu,
389 /// Do not use any autodetected include paths.
390 none,
391};
392
382/// Renders a `std.Target.Cpu` value into a textual representation that can be parsed393/// Renders a `std.Target.Cpu` value into a textual representation that can be parsed
383/// via the `-mcpu` flag passed to the Zig compiler.394/// via the `-mcpu` flag passed to the Zig compiler.
384/// Appends the result to `buffer`.395/// Appends the result to `buffer`.
src/Compilation.zig+2-13
...@@ -195,7 +195,7 @@ self_exe_path: ?[]const u8,...@@ -195,7 +195,7 @@ self_exe_path: ?[]const u8,
195dirs: Directories,195dirs: Directories,
196libc_include_dir_list: []const []const u8,196libc_include_dir_list: []const []const u8,
197libc_framework_dir_list: []const []const u8,197libc_framework_dir_list: []const []const u8,
198rc_includes: RcIncludes,198rc_includes: std.zig.RcIncludes,
199mingw_unicode_entry_point: bool,199mingw_unicode_entry_point: bool,
200thread_pool: *ThreadPool,200thread_pool: *ThreadPool,
201201
...@@ -954,17 +954,6 @@ pub const RcSourceFile = struct {...@@ -954,17 +954,6 @@ pub const RcSourceFile = struct {
954 extra_flags: []const []const u8 = &.{},954 extra_flags: []const []const u8 = &.{},
955};955};
956956
957pub const RcIncludes = enum {
958 /// Use MSVC if available, fall back to MinGW.
959 any,
960 /// Use MSVC include paths (MSVC install + Windows SDK, must be present on the system).
961 msvc,
962 /// Use MinGW include paths (distributed with Zig).
963 gnu,
964 /// Do not use any autodetected include paths.
965 none,
966};
967
968const Job = union(enum) {957const Job = union(enum) {
969 /// Given the generated AIR for a function, put it onto the code generation queue.958 /// Given the generated AIR for a function, put it onto the code generation queue.
970 /// This `Job` exists (instead of the `link.ZcuTask` being directly queued) to ensure that959 /// This `Job` exists (instead of the `link.ZcuTask` being directly queued) to ensure that
...@@ -1680,7 +1669,7 @@ pub const CreateOptions = struct {...@@ -1680,7 +1669,7 @@ pub const CreateOptions = struct {
1680 c_source_files: []const CSourceFile = &.{},1669 c_source_files: []const CSourceFile = &.{},
1681 rc_source_files: []const RcSourceFile = &.{},1670 rc_source_files: []const RcSourceFile = &.{},
1682 manifest_file: ?[]const u8 = null,1671 manifest_file: ?[]const u8 = null,
1683 rc_includes: RcIncludes = .any,1672 rc_includes: std.zig.RcIncludes = .any,
1684 link_inputs: []const link.Input = &.{},1673 link_inputs: []const link.Input = &.{},
1685 framework_dirs: []const []const u8 = &[0][]const u8{},1674 framework_dirs: []const []const u8 = &[0][]const u8{},
1686 frameworks: []const Framework = &.{},1675 frameworks: []const Framework = &.{},
src/main.zig+3-3
...@@ -918,7 +918,7 @@ fn buildOutputType(...@@ -918,7 +918,7 @@ fn buildOutputType(
918 var extra_cflags: std.ArrayListUnmanaged([]const u8) = .empty;918 var extra_cflags: std.ArrayListUnmanaged([]const u8) = .empty;
919 var extra_rcflags: std.ArrayListUnmanaged([]const u8) = .empty;919 var extra_rcflags: std.ArrayListUnmanaged([]const u8) = .empty;
920 var symbol_wrap_set: std.StringArrayHashMapUnmanaged(void) = .empty;920 var symbol_wrap_set: std.StringArrayHashMapUnmanaged(void) = .empty;
921 var rc_includes: Compilation.RcIncludes = .any;921 var rc_includes: std.zig.RcIncludes = .any;
922 var manifest_file: ?[]const u8 = null;922 var manifest_file: ?[]const u8 = null;
923 var linker_export_symbol_names: std.ArrayListUnmanaged([]const u8) = .empty;923 var linker_export_symbol_names: std.ArrayListUnmanaged([]const u8) = .empty;
924924
...@@ -6787,8 +6787,8 @@ fn accessFrameworkPath(...@@ -6787,8 +6787,8 @@ fn accessFrameworkPath(
6787 return false;6787 return false;
6788}6788}
67896789
6790fn parseRcIncludes(arg: []const u8) Compilation.RcIncludes {6790fn parseRcIncludes(arg: []const u8) std.zig.RcIncludes {
6791 return std.meta.stringToEnum(Compilation.RcIncludes, arg) orelse6791 return std.meta.stringToEnum(std.zig.RcIncludes, arg) orelse
6792 fatal("unsupported rc includes type: '{s}'", .{arg});6792 fatal("unsupported rc includes type: '{s}'", .{arg});
6793}6793}
67946794