Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(44)

Unified Diff: tools/gn/target_manager.h

Issue 21114002: Add initial prototype for the GN meta-buildsystem. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add owners and readme Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/gn/target_generator_unittest.cc ('k') | tools/gn/target_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/target_manager.h
diff --git a/tools/gn/target_manager.h b/tools/gn/target_manager.h
new file mode 100644
index 0000000000000000000000000000000000000000..2dd2aed7bee1581d725f5c8589a3a3b3e67b8111
--- /dev/null
+++ b/tools/gn/target_manager.h
@@ -0,0 +1,73 @@
+// 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.
+
+#ifndef TOOLS_GN_TARGET_MANAGER_H_
+#define TOOLS_GN_TARGET_MANAGER_H_
+
+#include <set>
+#include <vector>
+
+#include "base/basictypes.h"
+#include "base/containers/hash_tables.h"
+#include "base/synchronization/lock.h"
+#include "tools/gn/target.h"
+
+class BuildSettings;
+class Err;
+class ItemTree;
+class LocationRange;
+class ToolchainManager;
+class Value;
+
+// Manages all the targets in the system. This integrates with the ItemTree
+// to manage the target-specific rules and creation.
+//
+// This class is threadsafe.
+class TargetManager {
+ public:
+ explicit TargetManager(const BuildSettings* settings);
+ ~TargetManager();
+
+ // Gets a reference to a named target. The given target name is created if
+ // it doesn't exist.
+ //
+ // The label should be fully specified in that it should include an
+ // explicit toolchain.
+ //
+ // |specified_from_here| should indicate the dependency or the target
+ // generator causing this access for error message generation.
+ //
+ // |dep_from| should be set when a target is getting a dep that it depends
+ // on. |dep_from| indicates the target that specified the dependency. It
+ // will be used to track outstanding dependencies so we can know when the
+ // target and all of its dependencies are complete. It should be null when
+ // getting a target for other reasons.
+ //
+ // On failure, |err| will be set.
+ //
+ // The returned pointer must not be dereferenced until it's generated, since
+ // it could be being generated on another thread.
+ Target* GetTarget(const Label& label,
+ const LocationRange& specified_from_here,
+ Target* dep_from,
+ Err* err);
+
+ // Called by a target when it has been loaded from the .gin file. Its
+ // dependencies may or may not be resolved yet.
+ void TargetGenerationComplete(const Label& label);
+
+ // Returns a list of all targets.
+ void GetAllTargets(std::vector<const Target*>* all_targets) const;
+
+ private:
+ bool ScheduleInvocationLocked(const LocationRange& specified_from_here,
+ const Label& label,
+ Err* err);
+
+ const BuildSettings* build_settings_;
+
+ DISALLOW_COPY_AND_ASSIGN(TargetManager);
+};
+
+#endif // TOOLS_GN_TARGET_MANAGER_H
« no previous file with comments | « tools/gn/target_generator_unittest.cc ('k') | tools/gn/target_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698