blob: 8bc1e5271dc92a0d508289296d40ff300ba7f156 [file] [log] [blame]
// Copyright 2020 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 "base/logging.h"
#include "gn/builtin_tool.h"
#include "gn/target.h"
const char* BuiltinTool::kBuiltinToolPhony = "phony";
BuiltinTool::BuiltinTool(const char* n) : Tool(n) {
BuiltinTool::~BuiltinTool() = default;
BuiltinTool* BuiltinTool::AsBuiltin() {
return this;
const BuiltinTool* BuiltinTool::AsBuiltin() const {
return this;
bool BuiltinTool::ValidateName(const char* name) const {
return name == kBuiltinToolPhony;
void BuiltinTool::SetComplete() {
bool BuiltinTool::InitTool(Scope* scope, Toolchain* toolchain, Err* err) {
// Initialize default vars.
return Tool::InitTool(scope, toolchain, err);
bool BuiltinTool::ValidateSubstitution(const Substitution* sub_type) const {
if (name_ == kBuiltinToolPhony)
return IsValidToolSubstitution(sub_type);
return false;