[PATCH] D117407: [clang] Add include path for cppwinrt on Windows SDK 10.0.17134+
Kagami Sascha Rosylight via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sat Jan 15 14:38:31 PST 2022
saschanaz created this revision.
saschanaz added a reviewer: hans.
saschanaz requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
This fixes https://github.com/llvm/llvm-project/issues/53112 by adding cppwinrt to the include path when the SDK version is higher than 10.0.17134.0.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D117407
Files:
clang/lib/Driver/ToolChains/MSVC.cpp
clang/test/Driver/cl-sysroot.cpp
Index: clang/test/Driver/cl-sysroot.cpp
===================================================================
--- clang/test/Driver/cl-sysroot.cpp
+++ clang/test/Driver/cl-sysroot.cpp
@@ -17,6 +17,7 @@
// CHECK: "-internal-isystem" "[[ROOT]]{{/|\\\\}}Windows Kits{{/|\\\\}}10{{/|\\\\}}Include{{/|\\\\}}10.0.19041.0{{/|\\\\}}shared"
// CHECK: "-internal-isystem" "[[ROOT]]{{/|\\\\}}Windows Kits{{/|\\\\}}10{{/|\\\\}}Include{{/|\\\\}}10.0.19041.0{{/|\\\\}}um"
// CHECK: "-internal-isystem" "[[ROOT]]{{/|\\\\}}Windows Kits{{/|\\\\}}10{{/|\\\\}}Include{{/|\\\\}}10.0.19041.0{{/|\\\\}}winrt"
+// CHECK: "-internal-isystem" "[[ROOT]]{{/|\\\\}}Windows Kits{{/|\\\\}}10{{/|\\\\}}Include{{/|\\\\}}10.0.19041.0{{/|\\\\}}cppwinrt"
// CHECK: "-libpath:[[ROOT]]{{/|\\\\}}DIA SDK{{/|\\\\}}lib{{/|\\\\}}amd64"
// CHECK: "-libpath:[[ROOT]]{{/|\\\\}}VC{{/|\\\\}}Tools{{/|\\\\}}MSVC{{/|\\\\}}27.1828.18284{{/|\\\\}}lib{{/|\\\\}}x64"
Index: clang/lib/Driver/ToolChains/MSVC.cpp
===================================================================
--- clang/lib/Driver/ToolChains/MSVC.cpp
+++ clang/lib/Driver/ToolChains/MSVC.cpp
@@ -1333,6 +1333,15 @@
AddSystemIncludeWithSubfolder(DriverArgs, CC1Args, WindowsSDKDir,
"Include", windowsSDKIncludeVersion,
"winrt");
+ if (major >= 10) {
+ llvm::VersionTuple Tuple;
+ if (!Tuple.tryParse(windowsSDKIncludeVersion) &&
+ Tuple.getSubminor().getValueOr(0) >= 17134) {
+ AddSystemIncludeWithSubfolder(DriverArgs, CC1Args, WindowsSDKDir,
+ "Include", windowsSDKIncludeVersion,
+ "cppwinrt");
+ }
+ }
} else {
AddSystemIncludeWithSubfolder(DriverArgs, CC1Args, WindowsSDKDir,
"Include");
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D117407.400323.patch
Type: text/x-patch
Size: 1904 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220115/1634cf54/attachment.bin>
More information about the cfe-commits
mailing list