diff options
| author | Ryan Liptak <squeek502@hotmail.com> | 2023-09-05 23:00:28 -0700 |
|---|---|---|
| committer | Ryan Liptak <squeek502@hotmail.com> | 2023-09-17 03:09:45 -0700 |
| commit | 28f6559947b7acd2ef3c983c90e1215a0d75ae15 (patch) | |
| tree | 1355f8b4bc35daef63d55004ec2ba63438158336 /src/Compilation.zig | |
| parent | 2a56fe11756fc402a15f159d1c951000487ff3ad (diff) | |
| download | zig-28f6559947b7acd2ef3c983c90e1215a0d75ae15.tar.gz zig-28f6559947b7acd2ef3c983c90e1215a0d75ae15.zip | |
Add the ATLMFC include directory to the libc include dir list
https://learn.microsoft.com/en-us/cpp/mfc/mfc-and-atl
Note that this include directory gets added to %INCLUDE% by vcvarsall.bat, and is especially crucial when working with resource files (many .rc files within the https://github.com/microsoft/Windows-classic-samples/ set reference files from the ATLMFC include directory).
Diffstat (limited to 'src/Compilation.zig')
| -rw-r--r-- | src/Compilation.zig | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig index 2135ab8245..fdc154e0eb 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -5636,6 +5636,13 @@ fn detectLibCFromLibCInstallation(arena: Allocator, target: Target, lci: *const if (!is_redundant) list.appendAssumeCapacity(lci.sys_include_dir.?); if (target.os.tag == .windows) { + if (std.fs.path.dirname(lci.sys_include_dir.?)) |sys_include_dir_parent| { + // This include path will only exist when the optional "Desktop development with C++" + // is installed. It contains headers, .rc files, and resources. It is especially + // necessary when working with Windows resources. + const atlmfc_dir = try std.fs.path.join(arena, &[_][]const u8{ sys_include_dir_parent, "atlmfc", "include" }); + list.appendAssumeCapacity(atlmfc_dir); + } if (std.fs.path.dirname(lci.include_dir.?)) |include_dir_parent| { const um_dir = try std.fs.path.join(arena, &[_][]const u8{ include_dir_parent, "um" }); list.appendAssumeCapacity(um_dir); |
