r206934 - Driver: Honor %INCLUDE% when built with MinGW
Reid Kleckner
reid at kleckner.net
Tue Apr 22 17:15:12 PDT 2014
Author: rnk
Date: Tue Apr 22 19:15:12 2014
New Revision: 206934
URL: http://llvm.org/viewvc/llvm-project?rev=206934&view=rev
Log:
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.
Added:
cfe/trunk/test/Driver/windows-include-env.c
Modified:
cfe/trunk/lib/Driver/WindowsToolChain.cpp
Modified: cfe/trunk/lib/Driver/WindowsToolChain.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/WindowsToolChain.cpp?rev=206934&r1=206933&r2=206934&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/WindowsToolChain.cpp (original)
+++ cfe/trunk/lib/Driver/WindowsToolChain.cpp Tue Apr 22 19:15:12 2014
@@ -293,7 +293,6 @@ void Windows::AddClangSystemIncludeArgs(
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(
return;
}
+#ifdef _MSC_VER
std::string VSDir;
std::string WindowsSDKDir;
Added: cfe/trunk/test/Driver/windows-include-env.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/windows-include-env.c?rev=206934&view=auto
==============================================================================
--- cfe/trunk/test/Driver/windows-include-env.c (added)
+++ cfe/trunk/test/Driver/windows-include-env.c Tue Apr 22 19:15:12 2014
@@ -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"
More information about the cfe-commits
mailing list