diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-23 00:26:56 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-23 00:26:56 +0000 |
commit | ac1128e3801134c30a848eed0db7298826f8449b (patch) | |
tree | 947dcfceb075a78ed31561a61f57a40f5eb98566 /tools/gn/target.cc | |
parent | eb9f0e842aaaa18355e5b2908f0da7f761c89dca (diff) | |
download | chromium_src-ac1128e3801134c30a848eed0db7298826f8449b.zip chromium_src-ac1128e3801134c30a848eed0db7298826f8449b.tar.gz chromium_src-ac1128e3801134c30a848eed0db7298826f8449b.tar.bz2 |
This make the GN current dir be set on thte scope. This fixes a bug where a template execution uses the directory of the file containing the template declaration. This makes it impossible to refer to the input files which are normally specified relative to the invoking file.
I added a defined() function that returns true if a variable has been defined. This needed some magic function invocation help because we don't actually want to evaluate the argument.
I added an optional second argument to assert for an error message.
We now tolerate absolute file paths for sources and outputs. Grit was outputtings these, which was confusiong some of our assertions. We'll now check if such locations are inside our source tree and fix them up accordingly.
I fixed a bug in the "desc" command where a target would be listed as a dependent of itself. I also added the target type to the output.
Note that I didn't implement MakeAbsolutePathRelativeIfPossible on Windows. I will do this on Windows in a second pass. Currently it's an #error.
There are several fixes to custom script target outputs and fixes to variables leftover from when I converted paths to start with two slashes.
BUG=
R=scottmg@chromium.org
Review URL: https://codereview.chromium.org/23396002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@219161 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/gn/target.cc')
-rw-r--r-- | tools/gn/target.cc | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tools/gn/target.cc b/tools/gn/target.cc index a59ca6a..0d7a492 100644 --- a/tools/gn/target.cc +++ b/tools/gn/target.cc @@ -70,6 +70,28 @@ Target::Target(const Settings* settings, const Label& label) Target::~Target() { } +// static +const char* Target::GetStringForOutputType(OutputType type) { + switch (type) { + case UNKNOWN: + return "Unknown"; + case GROUP: + return "Group"; + case EXECUTABLE: + return "Executable"; + case SHARED_LIBRARY: + return "Shared library"; + case STATIC_LIBRARY: + return "Static library"; + case COPY_FILES: + return "Copy"; + case CUSTOM: + return "Custom"; + default: + return ""; + } +} + Target* Target::AsTarget() { return this; } |