blob: 0aff49d071bd7cafb65eaf57c3af63d195c8c6fb [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 <string>
#include "gn/substitution_list.h"
#include "gn/substitution_pattern.h"
#include "gn/tool.h"
// A built-in tool that is always available regardless of toolchain. So far, the
// only example of this is the phony rule that ninja provides.
class BuiltinTool : public Tool {
// Builtin tools
static const char kBuiltinToolPhony[];
// Explicit constructor. Note that |name| must be one of the kBuiltinToolXXX
// constant pointers defined above.
explicit BuiltinTool(const char* name);
// Manual RTTI and required functions ---------------------------------------
bool InitTool(Scope* block_scope, Toolchain* toolchain, Err* err);
bool ValidateName(const char* name) const override;
void SetComplete() override;
bool ValidateSubstitution(const Substitution* sub_type) const override;
BuiltinTool* AsBuiltin() override;
const BuiltinTool* AsBuiltin() const override;
BuiltinTool(const BuiltinTool&) = delete;
BuiltinTool& operator=(const BuiltinTool&) = delete;