OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |