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

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

Issue 1868023002: Add GN output prefix override and allow empty output extensions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
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/binary_target_generator.h" 5 #include "tools/gn/binary_target_generator.h"
6 6
7 #include "tools/gn/config_values_generator.h" 7 #include "tools/gn/config_values_generator.h"
8 #include "tools/gn/deps_iterator.h" 8 #include "tools/gn/deps_iterator.h"
9 #include "tools/gn/err.h" 9 #include "tools/gn/err.h"
10 #include "tools/gn/functions.h" 10 #include "tools/gn/functions.h"
(...skipping 13 matching lines...) Expand all
24 24
25 BinaryTargetGenerator::~BinaryTargetGenerator() { 25 BinaryTargetGenerator::~BinaryTargetGenerator() {
26 } 26 }
27 27
28 void BinaryTargetGenerator::DoRun() { 28 void BinaryTargetGenerator::DoRun() {
29 target_->set_output_type(output_type_); 29 target_->set_output_type(output_type_);
30 30
31 if (!FillOutputName()) 31 if (!FillOutputName())
32 return; 32 return;
33 33
34 if (!FillOutputPrefixOverride())
35 return;
36
34 if (!FillOutputExtension()) 37 if (!FillOutputExtension())
35 return; 38 return;
36 39
37 if (!FillSources()) 40 if (!FillSources())
38 return; 41 return;
39 42
40 if (!FillPublic()) 43 if (!FillPublic())
41 return; 44 return;
42 45
43 if (!FillCheckIncludes()) 46 if (!FillCheckIncludes())
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 bool BinaryTargetGenerator::FillOutputName() { 81 bool BinaryTargetGenerator::FillOutputName() {
79 const Value* value = scope_->GetValue(variables::kOutputName, true); 82 const Value* value = scope_->GetValue(variables::kOutputName, true);
80 if (!value) 83 if (!value)
81 return true; 84 return true;
82 if (!value->VerifyTypeIs(Value::STRING, err_)) 85 if (!value->VerifyTypeIs(Value::STRING, err_))
83 return false; 86 return false;
84 target_->set_output_name(value->string_value()); 87 target_->set_output_name(value->string_value());
85 return true; 88 return true;
86 } 89 }
87 90
91 bool BinaryTargetGenerator::FillOutputPrefixOverride() {
92 const Value* value = scope_->GetValue(variables::kOutputPrefixOverride, true);
93 if (!value)
94 return true;
95 if (!value->VerifyTypeIs(Value::BOOLEAN, err_))
96 return false;
97 target_->set_output_prefix_override(value->boolean_value());
98 return true;
99 }
100
88 bool BinaryTargetGenerator::FillOutputExtension() { 101 bool BinaryTargetGenerator::FillOutputExtension() {
89 const Value* value = scope_->GetValue(variables::kOutputExtension, true); 102 const Value* value = scope_->GetValue(variables::kOutputExtension, true);
90 if (!value) 103 if (!value)
91 return true; 104 return true;
92 if (!value->VerifyTypeIs(Value::STRING, err_)) 105 if (!value->VerifyTypeIs(Value::STRING, err_))
93 return false; 106 return false;
94 target_->set_output_extension(value->string_value()); 107 target_->set_output_extension(value->string_value());
95 return true; 108 return true;
96 } 109 }
97 110
(...skipping 26 matching lines...) Expand all
124 "deps."); 137 "deps.");
125 return false; 138 return false;
126 } 139 }
127 } 140 }
128 141
129 // Add to the set. 142 // Add to the set.
130 for (const auto& cur : circular) 143 for (const auto& cur : circular)
131 target_->allow_circular_includes_from().insert(cur); 144 target_->allow_circular_includes_from().insert(cur);
132 return true; 145 return true;
133 } 146 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698