| 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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 // If the public headers are defined, don't default to public. | 153 // If the public headers are defined, don't default to public. |
| 154 target_->set_all_headers_public(false); | 154 target_->set_all_headers_public(false); |
| 155 | 155 |
| 156 Target::FileList dest_public; | 156 Target::FileList dest_public; |
| 157 if (!ExtractListOfRelativeFiles(scope_->settings()->build_settings(), *value, | 157 if (!ExtractListOfRelativeFiles(scope_->settings()->build_settings(), *value, |
| 158 scope_->GetSourceDir(), &dest_public, err_)) | 158 scope_->GetSourceDir(), &dest_public, err_)) |
| 159 return; | 159 return; |
| 160 target_->public_headers().swap(dest_public); | 160 target_->public_headers().swap(dest_public); |
| 161 } | 161 } |
| 162 | 162 |
| 163 void TargetGenerator::FillSourcePrereqs() { | 163 void TargetGenerator::FillInputs() { |
| 164 const Value* value = scope_->GetValue(variables::kSourcePrereqs, true); | 164 const Value* value = scope_->GetValue(variables::kInputs, true); |
| 165 if (!value) | 165 if (!value) { |
| 166 // Older versions used "source_prereqs". Allow use of this variable until |
| 167 // all callers are updated. |
| 168 // TODO(brettw) remove this eventually. |
| 169 value = scope_->GetValue("source_prereqs", true); |
| 170 |
| 171 if (!value) |
| 172 return; |
| 173 } |
| 174 |
| 175 Target::FileList dest_inputs; |
| 176 if (!ExtractListOfRelativeFiles(scope_->settings()->build_settings(), *value, |
| 177 scope_->GetSourceDir(), &dest_inputs, err_)) |
| 166 return; | 178 return; |
| 167 | 179 target_->inputs().swap(dest_inputs); |
| 168 Target::FileList dest_reqs; | |
| 169 if (!ExtractListOfRelativeFiles(scope_->settings()->build_settings(), *value, | |
| 170 scope_->GetSourceDir(), &dest_reqs, err_)) | |
| 171 return; | |
| 172 target_->source_prereqs().swap(dest_reqs); | |
| 173 } | 180 } |
| 174 | 181 |
| 175 void TargetGenerator::FillConfigs() { | 182 void TargetGenerator::FillConfigs() { |
| 176 FillGenericConfigs(variables::kConfigs, &target_->configs()); | 183 FillGenericConfigs(variables::kConfigs, &target_->configs()); |
| 177 } | 184 } |
| 178 | 185 |
| 179 void TargetGenerator::FillDependentConfigs() { | 186 void TargetGenerator::FillDependentConfigs() { |
| 180 FillGenericConfigs(variables::kAllDependentConfigs, | 187 FillGenericConfigs(variables::kAllDependentConfigs, |
| 181 &target_->all_dependent_configs()); | 188 &target_->all_dependent_configs()); |
| 182 FillGenericConfigs(variables::kDirectDependentConfigs, | 189 FillGenericConfigs(variables::kDirectDependentConfigs, |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 | 258 |
| 252 void TargetGenerator::FillForwardDependentConfigs() { | 259 void TargetGenerator::FillForwardDependentConfigs() { |
| 253 const Value* value = scope_->GetValue( | 260 const Value* value = scope_->GetValue( |
| 254 variables::kForwardDependentConfigsFrom, true); | 261 variables::kForwardDependentConfigsFrom, true); |
| 255 if (value) { | 262 if (value) { |
| 256 ExtractListOfLabels(*value, scope_->GetSourceDir(), | 263 ExtractListOfLabels(*value, scope_->GetSourceDir(), |
| 257 ToolchainLabelForScope(scope_), | 264 ToolchainLabelForScope(scope_), |
| 258 &target_->forward_dependent_configs(), err_); | 265 &target_->forward_dependent_configs(), err_); |
| 259 } | 266 } |
| 260 } | 267 } |
| OLD | NEW |