summaryrefslogtreecommitdiffstats
path: root/src/msvc_helper-win32.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/msvc_helper-win32.cc')
-rw-r--r--src/msvc_helper-win32.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/msvc_helper-win32.cc b/src/msvc_helper-win32.cc
index f6b2a22..624bc2d 100644
--- a/src/msvc_helper-win32.cc
+++ b/src/msvc_helper-win32.cc
@@ -17,6 +17,7 @@
#include <string.h>
#include <windows.h>
+#include "includes_normalize.h"
#include "util.h"
namespace {
@@ -46,6 +47,13 @@ string CLWrapper::FilterShowIncludes(const string& line) {
}
// static
+bool CLWrapper::IsSystemInclude(const string& path) {
+ // TODO: this is a heuristic, perhaps there's a better way?
+ return (path.find("program files") != string::npos ||
+ path.find("microsoft visual studio") != string::npos);
+}
+
+// static
bool CLWrapper::FilterInputFilename(const string& line) {
// TODO: other extensions, like .asm?
return EndsWith(line, ".c") ||
@@ -115,7 +123,9 @@ int CLWrapper::Run(const string& command, string* extra_output) {
string include = FilterShowIncludes(line);
if (!include.empty()) {
- includes_.push_back(include);
+ include = IncludesNormalize::Normalize(include, NULL);
+ if (!IsSystemInclude(include))
+ includes_.push_back(include);
} else if (FilterInputFilename(line)) {
// Drop it.
// TODO: if we support compiling multiple output files in a single