diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-19 21:11:05 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-19 21:11:05 +0000 |
commit | 60749e1c3bc06c226a427f82363acc71ec976d03 (patch) | |
tree | 63c337a1665ef511d0ee7f624079badd8205c6c6 /tools/gn/ninja_target_writer.h | |
parent | 3624f729459ccda7125fe003e10ef53845e64286 (diff) | |
download | chromium_src-60749e1c3bc06c226a427f82363acc71ec976d03.zip chromium_src-60749e1c3bc06c226a427f82363acc71ec976d03.tar.gz chromium_src-60749e1c3bc06c226a427f82363acc71ec976d03.tar.bz2 |
This hooks up build flags from the command-line and the toolchain (for re-invoking the build).
Using this, I was able to make the NaCl build of base compile (if the correct NaCl toolchain is extracted in advance to the right location).
This is the first time I actually ran a cross-compile, and Ninja complained about duplicate rule definitions, so I now prefix rules in the non-default toolchain with the toolchain name. There were also some files that went in the wrong directory.
I moved the toolchain definitions from the other platforms into a new directory tree in build/toolchains to be more clear.
To make the toolchain args get passed to the build configuration, I had to add another state to the toolchain_manager's state machine, since we need to see those flags before starting that part of the build. This is described in more detail at the top of the .cc file.
Since I was moving stuff around, I wanted to find references to the thing I was moving, so wrote a new command to find places that reference a given target "gn refs".
I added new help for patterns since I used these for the new "refs" command.
I removed the requirement that declare_args only be called once in a given scope. It now can be used anywhere to facilitate module-specific arguments.
Because build arguments can now be declared anywhere, I added a "gn args" command-line command that will find and print all of the command line arguments passed into the build. It also prints the comment above the argument as a way to document it. The code to extract the comment is a but unfortunate. I think if/when we write an autoformatter, we'll need to incorporate comments into the parse tree more and this can be simplified greatly.
Fixes up build.ninja dependencies if you remove a buildfile. Because I specified all input buildfiles in build.ninja, it would fail if you removed any of them. I now write out the build deps (for regenerating the build) in a .d file which will tolerate missing files.
BUG=
R=scottmg@chromium.org
Review URL: https://codereview.chromium.org/22998003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@218320 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/gn/ninja_target_writer.h')
-rw-r--r-- | tools/gn/ninja_target_writer.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/gn/ninja_target_writer.h b/tools/gn/ninja_target_writer.h index 1964da3..4662200 100644 --- a/tools/gn/ninja_target_writer.h +++ b/tools/gn/ninja_target_writer.h @@ -28,6 +28,9 @@ class NinjaTargetWriter { protected: void WriteEnvironment(); + // Returns the toolchain associated with the target. + const Toolchain* GetToolchain() const; + const Settings* settings_; // Non-owning. const Target* target_; // Non-owning. std::ostream& out_; |