summaryrefslogtreecommitdiffstats
path: root/tools/gn/action_values.cc
blob: ede802079bbdae777c740762d6dac727bad4e17a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright (c) 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "tools/gn/action_values.h"

#include "tools/gn/settings.h"
#include "tools/gn/substitution_writer.h"
#include "tools/gn/target.h"

ActionValues::ActionValues() {
}

ActionValues::~ActionValues() {
}

void ActionValues::GetOutputsAsSourceFiles(
    const Target* target,
    std::vector<SourceFile>* result) const {
  if (target->output_type() == Target::COPY_FILES ||
      target->output_type() == Target::ACTION_FOREACH) {
    // Copy and foreach applies the outputs to the sources.
    SubstitutionWriter::ApplyListToSources(
        target->settings(), outputs_, target->sources(), result);
  } else {
    // Actions (and anything else that happens to specify an output) just use
    // the output list with no substitution.
    SubstitutionWriter::GetListAsSourceFiles(outputs_, result);
  }
}