Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(79)

Side by Side Diff: tools/gn/header_checker.cc

Issue 1207903002: Windows precompiled header support in GN (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Scott's grammar nits Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tools/gn/function_toolchain.cc ('k') | tools/gn/ninja_binary_target_writer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "tools/gn/header_checker.h" 5 #include "tools/gn/header_checker.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 151
152 void HeaderChecker::RunCheckOverFiles(const FileMap& files, bool force_check) { 152 void HeaderChecker::RunCheckOverFiles(const FileMap& files, bool force_check) {
153 if (files.empty()) 153 if (files.empty())
154 return; 154 return;
155 155
156 scoped_refptr<base::SequencedWorkerPool> pool( 156 scoped_refptr<base::SequencedWorkerPool> pool(
157 new base::SequencedWorkerPool(16, "HeaderChecker")); 157 new base::SequencedWorkerPool(16, "HeaderChecker"));
158 for (const auto& file : files) { 158 for (const auto& file : files) {
159 // Only check C-like source files (RC files also have includes). 159 // Only check C-like source files (RC files also have includes).
160 SourceFileType type = GetSourceFileType(file.first); 160 SourceFileType type = GetSourceFileType(file.first);
161 if (type != SOURCE_CC && type != SOURCE_H && type != SOURCE_C && 161 if (type != SOURCE_CPP && type != SOURCE_H && type != SOURCE_C &&
162 type != SOURCE_M && type != SOURCE_MM && type != SOURCE_RC) 162 type != SOURCE_M && type != SOURCE_MM && type != SOURCE_RC)
163 continue; 163 continue;
164 164
165 // If any target marks it as generated, don't check it. 165 // If any target marks it as generated, don't check it.
166 bool is_generated = false; 166 bool is_generated = false;
167 for (const auto& vect_i : file.second) 167 for (const auto& vect_i : file.second)
168 is_generated |= vect_i.is_generated; 168 is_generated |= vect_i.is_generated;
169 if (is_generated) 169 if (is_generated)
170 continue; 170 continue;
171 171
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
574 if (targets_with_other_toolchains.size() + 574 if (targets_with_other_toolchains.size() +
575 targets_with_matching_toolchains.size() > 1) 575 targets_with_matching_toolchains.size() > 1)
576 msg += "at least one of "; 576 msg += "at least one of ";
577 msg += "which should somehow be reachable."; 577 msg += "which should somehow be reachable.";
578 578
579 // Danger: must call CreatePersistentRange to put in Err. 579 // Danger: must call CreatePersistentRange to put in Err.
580 return Err(CreatePersistentRange(source_file, range), 580 return Err(CreatePersistentRange(source_file, range),
581 "Include not allowed.", msg); 581 "Include not allowed.", msg);
582 } 582 }
583 583
OLDNEW
« no previous file with comments | « tools/gn/function_toolchain.cc ('k') | tools/gn/ninja_binary_target_writer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698