blob: 552e3006da9dad72e3732d44d5f19ec976fe1670 [file] [log] [blame]
// Copyright (c) 2016 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 <set>
#include <string>
#include "base/files/file_path.h"
#include "gn/err.h"
#include "gn/target.h"
class Builder;
class BuildSettings;
class QtCreatorWriter {
static bool RunAndWriteFile(const BuildSettings* build_settings,
const Builder& builder,
Err* err,
const std::string& root_target);
QtCreatorWriter(const BuildSettings* build_settings,
const Builder& builder,
const base::FilePath& project_prefix,
const std::string& root_target_name);
void Run();
bool DiscoverTargets();
void HandleTarget(const Target* target);
void CollectDeps(const Target* target);
void AddToSources(const Target::FileList& files);
void GenerateFile(const base::FilePath::CharType* suffix,
const std::set<std::string>& items);
const BuildSettings* build_settings_;
const Builder& builder_;
base::FilePath project_prefix_;
std::string root_target_name_;
TargetSet targets_;
std::set<std::string> sources_;
std::set<std::string> includes_;
std::set<std::string> defines_;
Err err_;
QtCreatorWriter(const QtCreatorWriter&) = delete;
QtCreatorWriter& operator=(const QtCreatorWriter&) = delete;