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

Unified Diff: tools/gn/gyp_helper.h

Issue 26561005: GYP generator for GN (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 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/gyp_binary_target_writer.cc ('k') | tools/gn/gyp_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/gyp_helper.h
diff --git a/tools/gn/gyp_helper.h b/tools/gn/gyp_helper.h
new file mode 100644
index 0000000000000000000000000000000000000000..d3b15eccd186bb402fa77760bc6f9dab1131850f
--- /dev/null
+++ b/tools/gn/gyp_helper.h
@@ -0,0 +1,41 @@
+// 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_GYP_HELPER_H_
+#define TOOLS_GN_GYP_HELPER_H_
+
+#include <string>
+
+#include "base/basictypes.h"
+
+class Err;
+class SourceDir;
+class SourceFile;
+class Target;
+
+// Danger this class is NOT threadsafe and reads the targets in a
+// non-threadsafe way, so this should only be used in single-threaded mode.
+class GypHelper {
+ public:
+ GypHelper();
+ ~GypHelper();
+
+ SourceFile GetGypFileForTarget(const Target* target, Err* err) const;
+
+ // Returns the name part of the given target. Example "base". This will
+ // include toolchain info for non-default toolchains.
+ std::string GetNameForTarget(const Target* target) const;
+
+ // Returns a full reference to the given target, including the GYP file
+ // and name. Example "<(DEPTH)/base/base.gyp:base".
+ std::string GetFullRefForTarget(const Target* target) const;
+
+ std::string GetFileReference(const SourceFile& file) const;
+ std::string GetDirReference(const SourceDir& dir, bool include_slash) const;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(GypHelper);
+};
+
+#endif // TOOLS_GN_GYP_HELPER_H_
« no previous file with comments | « tools/gn/gyp_binary_target_writer.cc ('k') | tools/gn/gyp_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698