Commit da77d306b6

Ryan Liptak <squeek502@hotmail.com>
2025-11-08 04:16:52
Move/coalesce RcIncludes enum to `std.zig.RcIncludes`
1 parent f587209
Changed files (4)
lib/std/Build/Step/Compile.zig
@@ -66,13 +66,12 @@ installed_headers: std.array_list.Managed(HeaderInstallation),
 /// created otherwise.
 installed_headers_include_tree: ?*Step.WriteFile = null,
 
-// keep in sync with src/Compilation.zig:RcIncludes
 /// Behavior of automatic detection of include directories when compiling .rc files.
 ///  any: Use MSVC if available, fall back to MinGW.
 ///  msvc: Use MSVC include paths (must be present on the system).
 ///  gnu: Use MinGW include paths (distributed with Zig).
 ///  none: Do not use any autodetected include paths.
-rc_includes: enum { any, msvc, gnu, none } = .any,
+rc_includes: std.zig.RcIncludes = .any,
 
 /// (Windows) .manifest file to embed in the compilation
 /// Set via options; intended to be read-only after that.
lib/std/zig.zig
@@ -379,6 +379,17 @@ pub const Subsystem = enum {
 
 pub const CompressDebugSections = enum { none, zlib, zstd };
 
+pub const RcIncludes = enum {
+    /// Use MSVC if available, fall back to MinGW.
+    any,
+    /// Use MSVC include paths (MSVC install + Windows SDK, must be present on the system).
+    msvc,
+    /// Use MinGW include paths (distributed with Zig).
+    gnu,
+    /// Do not use any autodetected include paths.
+    none,
+};
+
 /// Renders a `std.Target.Cpu` value into a textual representation that can be parsed
 /// via the `-mcpu` flag passed to the Zig compiler.
 /// Appends the result to `buffer`.
src/Compilation.zig
@@ -195,7 +195,7 @@ self_exe_path: ?[]const u8,
 dirs: Directories,
 libc_include_dir_list: []const []const u8,
 libc_framework_dir_list: []const []const u8,
-rc_includes: RcIncludes,
+rc_includes: std.zig.RcIncludes,
 mingw_unicode_entry_point: bool,
 thread_pool: *ThreadPool,
 
@@ -954,17 +954,6 @@ pub const RcSourceFile = struct {
     extra_flags: []const []const u8 = &.{},
 };
 
-pub const RcIncludes = enum {
-    /// Use MSVC if available, fall back to MinGW.
-    any,
-    /// Use MSVC include paths (MSVC install + Windows SDK, must be present on the system).
-    msvc,
-    /// Use MinGW include paths (distributed with Zig).
-    gnu,
-    /// Do not use any autodetected include paths.
-    none,
-};
-
 const Job = union(enum) {
     /// Given the generated AIR for a function, put it onto the code generation queue.
     /// This `Job` exists (instead of the `link.ZcuTask` being directly queued) to ensure that
@@ -1680,7 +1669,7 @@ pub const CreateOptions = struct {
     c_source_files: []const CSourceFile = &.{},
     rc_source_files: []const RcSourceFile = &.{},
     manifest_file: ?[]const u8 = null,
-    rc_includes: RcIncludes = .any,
+    rc_includes: std.zig.RcIncludes = .any,
     link_inputs: []const link.Input = &.{},
     framework_dirs: []const []const u8 = &[0][]const u8{},
     frameworks: []const Framework = &.{},
src/main.zig
@@ -918,7 +918,7 @@ fn buildOutputType(
     var extra_cflags: std.ArrayListUnmanaged([]const u8) = .empty;
     var extra_rcflags: std.ArrayListUnmanaged([]const u8) = .empty;
     var symbol_wrap_set: std.StringArrayHashMapUnmanaged(void) = .empty;
-    var rc_includes: Compilation.RcIncludes = .any;
+    var rc_includes: std.zig.RcIncludes = .any;
     var manifest_file: ?[]const u8 = null;
     var linker_export_symbol_names: std.ArrayListUnmanaged([]const u8) = .empty;
 
@@ -6787,8 +6787,8 @@ fn accessFrameworkPath(
     return false;
 }
 
-fn parseRcIncludes(arg: []const u8) Compilation.RcIncludes {
-    return std.meta.stringToEnum(Compilation.RcIncludes, arg) orelse
+fn parseRcIncludes(arg: []const u8) std.zig.RcIncludes {
+    return std.meta.stringToEnum(std.zig.RcIncludes, arg) orelse
         fatal("unsupported rc includes type: '{s}'", .{arg});
 }