summaryrefslogtreecommitdiffstats
path: root/tools/gn/filesystem_utils.h
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-19 22:52:16 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-19 22:54:04 +0000
commit0dfcae783a9285e3a3099f7098f076ef7b093f6e (patch)
tree543118667a7393e30934ae7c14050d4686219657 /tools/gn/filesystem_utils.h
parentc9a47cccedaa0556b52c1ceeb6c6a0d0b2f018f9 (diff)
downloadchromium_src-0dfcae783a9285e3a3099f7098f076ef7b093f6e.zip
chromium_src-0dfcae783a9285e3a3099f7098f076ef7b093f6e.tar.gz
chromium_src-0dfcae783a9285e3a3099f7098f076ef7b093f6e.tar.bz2
Support more configurability in GN toolchains
This uses substitution patterns in toolchains to allow the toolchain to specify more flexibly how files are to be named and generated at each step. The toolchain now has control over the naming of object and executable files, for example, where before these were hardcoded. This removes most of the OS-specific logic hardcoded into the GN tool. There is still a bunch in action invocation; this will be done in a followup. R=jamesr@chromium.org Review URL: https://codereview.chromium.org/440333002 Cr-Commit-Position: refs/heads/master@{#290685} git-svn-id: svn://svn.chromium.org/chrome/trunk/src@290685 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/gn/filesystem_utils.h')
-rw-r--r--tools/gn/filesystem_utils.h36
1 files changed, 17 insertions, 19 deletions
diff --git a/tools/gn/filesystem_utils.h b/tools/gn/filesystem_utils.h
index 71e7057..20773cc 100644
--- a/tools/gn/filesystem_utils.h
+++ b/tools/gn/filesystem_utils.h
@@ -16,21 +16,6 @@ class Err;
class Location;
class Value;
-enum SourceFileType {
- SOURCE_UNKNOWN,
- SOURCE_ASM,
- SOURCE_C,
- SOURCE_CC,
- SOURCE_H,
- SOURCE_M,
- SOURCE_MM,
- SOURCE_S,
- SOURCE_RC,
- SOURCE_O, // Object files can be inputs, too. Also counts .obj.
-};
-
-SourceFileType GetSourceFileType(const SourceFile& file);
-
// Returns the extension, not including the dot, for the given file type on the
// given system.
//
@@ -102,13 +87,13 @@ base::StringPiece FindLastDirComponent(const SourceDir& dir);
// it is designed for a sanity check to keep people from writing output files
// to the source directory accidentally.
//
-// The originating value will be blamed in the error.
+// The origin will be blamed in the error.
//
// If the file isn't in the dir, returns false and sets the error. Otherwise
// returns true and leaves the error untouched.
bool EnsureStringIsInOutputDir(const SourceDir& dir,
const std::string& str,
- const Value& originating,
+ const ParseNode* origin,
Err* err);
// ----------------------------------------------------------------------------
@@ -178,15 +163,28 @@ std::string GetOutputSubdirName(const Label& toolchain_label, bool is_default);
SourceDir GetToolchainOutputDir(const Settings* settings);
SourceDir GetToolchainOutputDir(const BuildSettings* build_settings,
const Label& label, bool is_default);
+
SourceDir GetToolchainGenDir(const Settings* settings);
+OutputFile GetToolchainGenDirAsOutputFile(const Settings* settings);
SourceDir GetToolchainGenDir(const BuildSettings* build_settings,
- const Label& toolchain_label, bool is_default);
+ const Label& toolchain_label,
+ bool is_default);
+
SourceDir GetOutputDirForSourceDir(const Settings* settings,
const SourceDir& source_dir);
+OutputFile GetOutputDirForSourceDirAsOutputFile(const Settings* settings,
+ const SourceDir& source_dir);
+
SourceDir GetGenDirForSourceDir(const Settings* settings,
- const SourceDir& source_dir);
+ const SourceDir& source_dir);
+OutputFile GetGenDirForSourceDirAsOutputFile(const Settings* settings,
+ const SourceDir& source_dir);
+
SourceDir GetTargetOutputDir(const Target* target);
+OutputFile GetTargetOutputDirAsOutputFile(const Target* target);
SourceDir GetTargetGenDir(const Target* target);
+OutputFile GetTargetGenDirAsOutputFile(const Target* target);
+
SourceDir GetCurrentOutputDir(const Scope* scope);
SourceDir GetCurrentGenDir(const Scope* scope);