Driver: Honor %INCLUDE% when built with MinGW

Users are expected to pass system includes through the INCLUDE
environment variable on Windows.  There's no reason to change behavior
based on the toolchain used to build Clang.

I didn't change the registry searching code because I'm not sure it
builds with mingw and I'm not set up to test it.

llvm-svn: 206934
This commit is contained in:
Reid Kleckner 2014-04-23 00:15:12 +00:00
parent 77b45ba301
commit 9aff2ca27c
2 changed files with 5 additions and 1 deletions

View File

@ -293,7 +293,6 @@ void Windows::AddClangSystemIncludeArgs(const ArgList &DriverArgs,
if (DriverArgs.hasArg(options::OPT_nostdlibinc))
return;
#ifdef _MSC_VER
// Honor %INCLUDE%. It should know essential search paths with vcvarsall.bat.
if (const char *cl_include_dir = getenv("INCLUDE")) {
SmallVector<StringRef, 8> Dirs;
@ -305,6 +304,7 @@ void Windows::AddClangSystemIncludeArgs(const ArgList &DriverArgs,
return;
}
#ifdef _MSC_VER
std::string VSDir;
std::string WindowsSDKDir;

View File

@ -0,0 +1,4 @@
// RUN: env INCLUDE=my_system_headers %clang -c %s -### 2>&1 | FileCheck %s
// RUN: env INCLUDE=my_system_headers %clang_cl -c %s -### 2>&1 | FileCheck %s
// CHECK: "-cc1"
// CHECK: "-internal-isystem" "my_system_headers"