| ... | @@ -2549,7 +2549,22 @@ pub const LibExeObjStep = struct { | ... | @@ -2549,7 +2549,22 @@ pub const LibExeObjStep = struct { |
| 2549 | } else { | 2549 | } else { |
| 2550 | try zig_args.append("-isystem"); | 2550 | try zig_args.append("-isystem"); |
| 2551 | } | 2551 | } |
| 2552 | try zig_args.append(self.builder.pathFromRoot(include_path)); | 2552 | |
| | 2553 | const resolved_include_path = self.builder.pathFromRoot(include_path); |
| | 2554 | |
| | 2555 | const common_include_path = if (std.Target.current.os.tag == .windows and builder.sysroot != null and fs.path.isAbsolute(resolved_include_path)) blk: { |
| | 2556 | // We need to check for disk designator and strip it out from dir path so |
| | 2557 | // that zig/clang can concat resolved_include_path with sysroot. |
| | 2558 | const disk_designator = fs.path.diskDesignatorWindows(resolved_include_path); |
| | 2559 | |
| | 2560 | if (mem.indexOf(u8, resolved_include_path, disk_designator)) |where| { |
| | 2561 | break :blk resolved_include_path[where + disk_designator.len ..]; |
| | 2562 | } |
| | 2563 | |
| | 2564 | break :blk resolved_include_path; |
| | 2565 | } else resolved_include_path; |
| | 2566 | |
| | 2567 | try zig_args.append(common_include_path); |
| 2553 | }, | 2568 | }, |
| 2554 | .other_step => |other| if (other.emit_h) { | 2569 | .other_step => |other| if (other.emit_h) { |
| 2555 | const h_path = other.getOutputHSource().getPath(self.builder); | 2570 | const h_path = other.getOutputHSource().getPath(self.builder); |