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

Unified Diff: tools/gn/pool.h

Issue 2006923004: Add support for user defined "pool" to GN. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 6 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
Index: tools/gn/pool.h
diff --git a/tools/gn/pool.h b/tools/gn/pool.h
new file mode 100644
index 0000000000000000000000000000000000000000..d719364d60d263f928e797aed7081992f3c6c839
--- /dev/null
+++ b/tools/gn/pool.h
@@ -0,0 +1,41 @@
+// Copyright 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.
+
+#ifndef TOOLS_GN_POOL_H_
+#define TOOLS_GN_POOL_H_
+
+#include <string>
+
+#include "tools/gn/item.h"
+
+// Represents a named pool in the dependency graph.
+//
+// A pool is used to limit the parallelism of task invocation in the
+// generated ninja build. Pools are referenced by toolchains.
+class Pool : public Item {
+ public:
+ Pool(const Settings* settings, const Label& label);
+ ~Pool() override;
+
+ Pool(const Pool&) = delete;
+ Pool& operator=(const Pool&) = delete;
+
+ // Item implementation.
+ Pool* AsPool() override;
+ const Pool* AsPool() const override;
+
+ // The pool depth (number of task to run simultaneously).
+ int64_t depth() const { return depth_; }
+ void set_depth(int64_t depth) { depth_ = depth; }
+
+ // The pool name in generated ninja files.
+ std::string GetNinjaName(const Label& default_toolchain) const;
+
+ private:
+ std::string GetNinjaName(bool include_toolchain) const;
+
+ int64_t depth_ = 0;
+};
+
+#endif // TOOLS_GN_POOL_H_
« tools/gn/functions.cc ('K') | « tools/gn/ninja_writer.cc ('k') | tools/gn/pool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698