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

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

Issue 216903004: Add optional public header checking to GN build (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: unit test Created 6 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « tools/gn/target_generator.h ('k') | tools/gn/trace.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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/target_generator.h" 5 #include "tools/gn/target_generator.h"
6 6
7 #include "tools/gn/action_target_generator.h" 7 #include "tools/gn/action_target_generator.h"
8 #include "tools/gn/binary_target_generator.h" 8 #include "tools/gn/binary_target_generator.h"
9 #include "tools/gn/build_settings.h" 9 #include "tools/gn/build_settings.h"
10 #include "tools/gn/config.h" 10 #include "tools/gn/config.h"
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 if (!value) 130 if (!value)
131 return; 131 return;
132 132
133 Target::FileList dest_sources; 133 Target::FileList dest_sources;
134 if (!ExtractListOfRelativeFiles(scope_->settings()->build_settings(), *value, 134 if (!ExtractListOfRelativeFiles(scope_->settings()->build_settings(), *value,
135 scope_->GetSourceDir(), &dest_sources, err_)) 135 scope_->GetSourceDir(), &dest_sources, err_))
136 return; 136 return;
137 target_->sources().swap(dest_sources); 137 target_->sources().swap(dest_sources);
138 } 138 }
139 139
140 void TargetGenerator::FillPublic() {
141 const Value* value = scope_->GetValue(variables::kPublic, true);
142 if (!value)
143 return;
144
145 // If the public headers are defined, don't default to public.
146 target_->set_all_headers_public(false);
147
148 Target::FileList dest_public;
149 if (!ExtractListOfRelativeFiles(scope_->settings()->build_settings(), *value,
150 scope_->GetSourceDir(), &dest_public, err_))
151 return;
152 target_->public_headers().swap(dest_public);
153 }
154
140 void TargetGenerator::FillSourcePrereqs() { 155 void TargetGenerator::FillSourcePrereqs() {
141 const Value* value = scope_->GetValue(variables::kSourcePrereqs, true); 156 const Value* value = scope_->GetValue(variables::kSourcePrereqs, true);
142 if (!value) 157 if (!value)
143 return; 158 return;
144 159
145 Target::FileList dest_reqs; 160 Target::FileList dest_reqs;
146 if (!ExtractListOfRelativeFiles(scope_->settings()->build_settings(), *value, 161 if (!ExtractListOfRelativeFiles(scope_->settings()->build_settings(), *value,
147 scope_->GetSourceDir(), &dest_reqs, err_)) 162 scope_->GetSourceDir(), &dest_reqs, err_))
148 return; 163 return;
149 target_->source_prereqs().swap(dest_reqs); 164 target_->source_prereqs().swap(dest_reqs);
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 254
240 void TargetGenerator::FillForwardDependentConfigs() { 255 void TargetGenerator::FillForwardDependentConfigs() {
241 const Value* value = scope_->GetValue( 256 const Value* value = scope_->GetValue(
242 variables::kForwardDependentConfigsFrom, true); 257 variables::kForwardDependentConfigsFrom, true);
243 if (value) { 258 if (value) {
244 ExtractListOfLabels(*value, scope_->GetSourceDir(), 259 ExtractListOfLabels(*value, scope_->GetSourceDir(),
245 ToolchainLabelForScope(scope_), 260 ToolchainLabelForScope(scope_),
246 &target_->forward_dependent_configs(), err_); 261 &target_->forward_dependent_configs(), err_);
247 } 262 }
248 } 263 }
OLDNEW
« no previous file with comments | « tools/gn/target_generator.h ('k') | tools/gn/trace.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698