diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-22 22:09:55 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-22 22:09:55 +0000 |
commit | 05b94b4340501afbc32619c5b10a1d7c533670cd (patch) | |
tree | 1e6d8dc92f528514b445f950f35d3a0d833cfbee /tools/gn/filesystem_utils.h | |
parent | bd71e95c4cd64660daf4e00be2a66cd96a022a2c (diff) | |
download | chromium_src-05b94b4340501afbc32619c5b10a1d7c533670cd.zip chromium_src-05b94b4340501afbc32619c5b10a1d7c533670cd.tar.gz chromium_src-05b94b4340501afbc32619c5b10a1d7c533670cd.tar.bz2 |
This writes a generator for GYP actions to run Ninja for script targets. This does not yet include the code that actually writes the corresponding ninja files.
The GYP code also needed some output directory generation code, so this was consolidated in filesystem_utils and referenced from the existing place.
BUG=322244
R=scottmg@chromium.org
Review URL: https://codereview.chromium.org/80463004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@236837 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/gn/filesystem_utils.h')
-rw-r--r-- | tools/gn/filesystem_utils.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tools/gn/filesystem_utils.h b/tools/gn/filesystem_utils.h index 9899cae..152851d 100644 --- a/tools/gn/filesystem_utils.h +++ b/tools/gn/filesystem_utils.h @@ -138,4 +138,25 @@ std::string PathToSystem(const std::string& path); std::string RebaseSourceAbsolutePath(const std::string& input, const SourceDir& dest_dir); +// Returns the given directory with no terminating slash at the end, such that +// appending a slash and more stuff will produce a valid path. +// +// If the directory refers to either the source or system root, we'll append +// a "." so this remains valid. +std::string DirectoryWithNoLastSlash(const SourceDir& dir); + +// ----------------------------------------------------------------------------- + +// These functions return the various flavors of output and gen directories. +SourceDir GetToolchainOutputDir(const Settings* settings); +SourceDir GetToolchainGenDir(const Settings* settings); +SourceDir GetOutputDirForSourceDir(const Settings* settings, + const SourceDir& source_dir); +SourceDir GetGenDirForSourceDir(const Settings* settings, + const SourceDir& source_dir); +SourceDir GetTargetOutputDir(const Target* target); +SourceDir GetTargetGenDir(const Target* target); +SourceDir GetCurrentOutputDir(const Scope* scope); +SourceDir GetCurrentGenDir(const Scope* scope); + #endif // TOOLS_GN_FILESYSTEM_UTILS_H_ |