<div dir="ltr"><div>Running in a vcvars.bat shell environment should make this work without changing clang.</div><div><br></div><div>Clang only checks these hardcoded paths when the INCLUDE variable isn't set. This code in clang/lib/Driver/MSVCToolChain.cpp needs work to deal with the Windows 10 SDK:</div><div><br></div><div><div>    if (getWindowsSDKDir(WindowsSDKDir, major, minor)) {</div><div>      if (major >= 8) {</div><div>        AddSystemIncludeWithSubfolder(DriverArgs, CC1Args, WindowsSDKDir,</div><div>                                      "include\\shared");</div><div>        AddSystemIncludeWithSubfolder(DriverArgs, CC1Args, WindowsSDKDir,</div><div>                                      "include\\um");</div><div>        AddSystemIncludeWithSubfolder(DriverArgs, CC1Args, WindowsSDKDir,</div><div>                                      "include\\winrt");</div><div>      } else {</div><div>        AddSystemIncludeWithSubfolder(DriverArgs, CC1Args, WindowsSDKDir,</div><div>                                      "include");</div><div>      }</div><div>    } else {</div></div><div><br></div><div>If you can easily test changes to this code, a patch would be welcome.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Aug 5, 2015 at 10:34 PM, Rexdf via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">>clang -v -E -x c++ -<br>
clang version 3.8.0 (trunk 243961)<br>
Target: x86_64-pc-windows-msvc<br>
Thread model: posix<br>
 "C:\\llvim3.8.0\\bin\\clang.exe" -cc1 -triple<br>
x86_64-pc-windows-msvc18.0.0 -E -disable-free -disable-llvm-verifier<br>
-main-file-name - -mrelocation-model pic -pic-level 2 -mthread<br>
-model posix -fmath-errno -masm-verbose -mconstructor-aliases<br>
-munwind-tables -target-cpu x86-64 -momit-leaf-frame-pointer -v<br>
-dwarf-column-info -resource-dir "C:\\llvim3.8.0\\bi<br>
n\\..\\lib\\clang\\3.8.0" -internal-isystem<br>
"C:\\llvim3.8.0\\bin\\..\\lib\\clang\\3.8.0\\include"<br>
-internal-isystem "C:\\Program Files (x86)\\Microsoft Visual Studio<br>
14.0\\VC\\in<br>
clude" -internal-isystem "C:\\Program Files (x86)\\Windows<br>
Kits\\10\\include\\shared" -internal-isystem "C:\\Program Files<br>
(x86)\\Windows Kits\\10\\include\\um" -internal-isystem "C:\\Progr<br>
am Files (x86)\\Windows Kits\\10\\include\\winrt" -fdeprecated-macro<br>
-fdebug-compilation-dir "C:\\llvim3.8.0\\bin" -ferror-limit 19<br>
-fmessage-length 189 -mstackrealign -fms-exten<br>
sions -fms-compatibility -fms-compatibility-version=18 -std=c++11<br>
-fno-threadsafe-statics -fdelayed-template-parsing -fobjc-runtime=gcc<br>
-fdiagnostics-show-option -fcolor-diagnostics -o - -x<br>
 c++ -<br>
clang -cc1 version 3.8.0 based upon LLVM 3.8.0svn default target<br>
x86_64-pc-windows-msvc<br>
ignoring nonexistent directory "C:\Program Files (x86)\Windows<br>
Kits\10\include\shared"<br>
ignoring nonexistent directory "C:\Program Files (x86)\Windows<br>
Kits\10\include\um"<br>
ignoring nonexistent directory "C:\Program Files (x86)\Windows<br>
Kits\10\include\winrt"<br>
#include "..." search starts here:<br>
#include <...> search starts here:<br>
 C:\llvim3.8.0\bin\..\lib\clang\3.8.0\include<br>
 C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include<br>
End of search list.<br>
<br>
It should be `C:\Program Files (x86)\Windows<br>
Kits\10\Include\10.0.10240.0\shared` etc.<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>         <a href="http://llvm.cs.uiuc.edu" rel="noreferrer" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div><br></div>