authorgravatar for andrew.gutekanst@gmail.comAndrew Gutekanst <andrew.gutekanst@gmail.com> 2021-09-12 19:35:03-04:00
committergravatar for andrew.gutekanst@gmail.comAndrew Gutekanst <andrew.gutekanst@gmail.com> 2021-09-12 19:35:03-04:00
logffb989169594cbfcfefbbcc00dd7c3d07f1a9949
tree4ad88622db40fa39d7339f0cdb29d923d69db92b
parent62a6d83da11553daadb7d463330571f361c771d8

Fix same issue with dir/sysroot dir concatenation with includes on Windows


1 files changed, 16 insertions(+), 1 deletions(-)

lib/std/build.zig+16-1
......@@ -2549,7 +2549,22 @@ pub const LibExeObjStep = struct {
25492549 } else {
25502550 try zig_args.append("-isystem");
25512551 }
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);
25532568 },
25542569 .other_step => |other| if (other.emit_h) {
25552570 const h_path = other.getOutputHSource().getPath(self.builder);