Recursive includes not functioning?

Hi, I'm wondering why clang doesn't seem to be including files recursively:

Windows.h is in C:\Program Files (x86)\Windows Kits\8.1\Include\um and clang-cl automatically includes C:\Program Files (x86)\Windows Kits\8.1\includes yet Windows.h is not found?

I:\LLVM_BUILD_VC12\Release\bin>clang-cl -v test.cpp /Fotest.o -c
clang version 3.5.0 (trunk)
Target: i686-pc-win32
Thread model: posix
  "I:\LLVM_BUILD_VC12\Release\bin\clang-cl.exe" -cc1 -triple i686-pc-win32 -emit-
obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name test.cpp -m
relocation-model static -mdisable-fp-elim -fmath-errno -masm-verbose -mconstruct
or-aliases -target-cpu pentium4 -D_MT --dependent-lib=libcmt --dependent-lib=old
names -fno-rtti -fdiagnostics-format msvc -v -coverage-file "I:\\LLVM_BUILD_VC12
\\Release\\bin\\test.o" -resource-dir "I:\\LLVM_BUILD_VC12\\Release\\bin\\..\\li
b\\clang\\3.5.0" -internal-isystem "I:\\LLVM_BUILD_VC12\\Release\\bin\\..\\lib\\
clang\\3.5.0\\include" -internal-isystem "I:\\Microsoft Visual Studio 12.0\\VC\\
include" -internal-isystem "C:\\Program Files (x86)\\Windows Kits\\8.1\\\\includ
e" -std=c++11 -fdeprecated-macro -fdebug-compilation-dir "I:\\LLVM_BUILD_VC12\\R
elease\\bin" -ferror-limit 19 -fmessage-length 80 -mstackrealign -fms-extensions
  -fms-compatibility -fmsc-version=1700 -fdelayed-template-parsing -fobjc-runtime
=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics
  -vectorize-slp -o test.o -x c++ test.cpp
clang -cc1 version 3.5.0 based upon LLVM 3.5.0svn default target i686-pc-win32
#include "..." search starts here:
#include <...> search starts here:
  I:\Microsoft Visual Studio 12.0\VC\include
  C:\Program Files (x86)\Windows Kits\8.1\\include
End of search list.
test.cpp(1,10) : fatal error: 'Windows.h' file not found
#include <Windows.h>
1 error generated.


Clang uses the INCLUDE environment variable, which is what MSVC does. Otherwise I think it tries to guess, and it will probably guess poorly. Is your environment set up the same way that vcvars.bat would set up the environment for cl.exe? That’s the best way to get the compatible behavior.

In this case, it looks like you have “C:…\include” in INCLUDE instead of “C:…\include\um” and “C:…\include\shared”.