| ... | @@ -59,15 +59,18 @@ pub fn create(owner: *std.Build, options: Options) *ConfigHeader { | ... | @@ -59,15 +59,18 @@ pub fn create(owner: *std.Build, options: Options) *ConfigHeader { |
| 59 | | 59 | |
| 60 | var include_path: []const u8 = "config.h"; | 60 | var include_path: []const u8 = "config.h"; |
| 61 | | 61 | |
| 62 | if (options.style.getPath()) |s| switch (s) { | 62 | if (options.style.getPath()) |s| default_include_path: { |
| 63 | .path => |p| { | 63 | const sub_path = switch (s) { |
| 64 | const basename = std.fs.path.basename(p); | 64 | .path => |path| path, |
| 65 | if (std.mem.endsWith(u8, basename, ".h.in")) { | 65 | .generated => break :default_include_path, |
| 66 | include_path = basename[0 .. basename.len - 3]; | 66 | .cwd_relative => |sub_path| sub_path, |
| 67 | } | 67 | .dependency => |dependency| dependency.sub_path, |
| 68 | }, | 68 | }; |
| 69 | else => {}, | 69 | const basename = std.fs.path.basename(sub_path); |
| 70 | }; | 70 | if (std.mem.endsWith(u8, basename, ".h.in")) { |
| | 71 | include_path = basename[0 .. basename.len - 3]; |
| | 72 | } |
| | 73 | } |
| 71 | | 74 | |
| 72 | if (options.include_path) |p| { | 75 | if (options.include_path) |p| { |
| 73 | include_path = p; | 76 | include_path = p; |
| ... | @@ -181,6 +184,8 @@ fn make(step: *Step, prog_node: *std.Progress.Node) !void { | ... | @@ -181,6 +184,8 @@ fn make(step: *Step, prog_node: *std.Progress.Node) !void { |
| 181 | // random bytes when ConfigHeader implementation is modified in a | 184 | // random bytes when ConfigHeader implementation is modified in a |
| 182 | // non-backwards-compatible way. | 185 | // non-backwards-compatible way. |
| 183 | man.hash.add(@as(u32, 0xdef08d23)); | 186 | man.hash.add(@as(u32, 0xdef08d23)); |
| | 187 | man.hash.addBytes(self.include_path); |
| | 188 | man.hash.addOptionalBytes(self.include_guard_override); |
| 184 | | 189 | |
| 185 | var output = std.ArrayList(u8).init(gpa); | 190 | var output = std.ArrayList(u8).init(gpa); |
| 186 | defer output.deinit(); | 191 | defer output.deinit(); |