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
3 // found in the LICENSE file.
5 #include "tools/gn/group_target_generator.h"
7 #include "tools/gn/variables.h"
9 GroupTargetGenerator::GroupTargetGenerator(
12 const FunctionCallNode* function_call,
14 : TargetGenerator(target, scope, function_call, err) {
17 GroupTargetGenerator::~GroupTargetGenerator() {
20 void GroupTargetGenerator::DoRun() {
21 target_->set_output_type(Target::GROUP);
22 // Groups only have the default types filled in by the target generator
25 // Before there was a deps/public_deps split, a group acted like all deps
26 // are public. During a transition period, if public_deps is not defined,
27 // treat all deps as public. This should be removed and existing groups
28 // updated to use "public_deps" when needed.
29 if (scope_->GetValue(variables::kDeps, false) &&
30 !scope_->GetValue(variables::kPublicDeps, false)) {
31 std::swap(target_->private_deps(), target_->public_deps());