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.h" | 5 #include "tools/gn/target.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "tools/gn/config_values_extractors.h" | 10 #include "tools/gn/config_values_extractors.h" |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 // (expanded groups) will have a null origin. We don't want to check | 355 // (expanded groups) will have a null origin. We don't want to check |
356 // visibility for these, since the point of a group would often be to | 356 // visibility for these, since the point of a group would often be to |
357 // forward visibility. | 357 // forward visibility. |
358 for (size_t i = 0; i < deps_.size(); i++) { | 358 for (size_t i = 0; i < deps_.size(); i++) { |
359 if (deps_[i].origin && | 359 if (deps_[i].origin && |
360 !Visibility::CheckItemVisibility(this, deps_[i].ptr, err)) | 360 !Visibility::CheckItemVisibility(this, deps_[i].ptr, err)) |
361 return false; | 361 return false; |
362 } | 362 } |
363 | 363 |
364 for (size_t i = 0; i < datadeps_.size(); i++) { | 364 for (size_t i = 0; i < datadeps_.size(); i++) { |
365 if (deps_[i].origin && | 365 if (datadeps_[i].origin && |
366 !Visibility::CheckItemVisibility(this, datadeps_[i].ptr, err)) | 366 !Visibility::CheckItemVisibility(this, datadeps_[i].ptr, err)) |
367 return false; | 367 return false; |
368 } | 368 } |
369 | 369 |
370 return true; | 370 return true; |
371 } | 371 } |
372 | 372 |
373 bool Target::CheckTestonly(Err* err) const { | 373 bool Target::CheckTestonly(Err* err) const { |
374 // If there current target is marked testonly, it can include both testonly | 374 // If there current target is marked testonly, it can include both testonly |
375 // and non-testonly targets, so there's nothing to check. | 375 // and non-testonly targets, so there's nothing to check. |
(...skipping 10 matching lines...) Expand all Loading... |
386 | 386 |
387 for (size_t i = 0; i < datadeps_.size(); i++) { | 387 for (size_t i = 0; i < datadeps_.size(); i++) { |
388 if (datadeps_[i].ptr->testonly()) { | 388 if (datadeps_[i].ptr->testonly()) { |
389 *err = MakeTestOnlyError(this, datadeps_[i].ptr); | 389 *err = MakeTestOnlyError(this, datadeps_[i].ptr); |
390 return false; | 390 return false; |
391 } | 391 } |
392 } | 392 } |
393 | 393 |
394 return true; | 394 return true; |
395 } | 395 } |
OLD | NEW |