summaryrefslogtreecommitdiffstats
path: root/tools/gn/toolchain.cc
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-19 21:11:05 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-19 21:11:05 +0000
commit60749e1c3bc06c226a427f82363acc71ec976d03 (patch)
tree63c337a1665ef511d0ee7f624079badd8205c6c6 /tools/gn/toolchain.cc
parent3624f729459ccda7125fe003e10ef53845e64286 (diff)
downloadchromium_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/toolchain.cc')
-rw-r--r--tools/gn/toolchain.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/gn/toolchain.cc b/tools/gn/toolchain.cc
index d906b9a..cf9bfdb 100644
--- a/tools/gn/toolchain.cc
+++ b/tools/gn/toolchain.cc
@@ -5,6 +5,7 @@
#include "tools/gn/toolchain.h"
#include "base/logging.h"
+#include "tools/gn/value.h"
const char* Toolchain::kToolCc = "cc";
const char* Toolchain::kToolCxx = "cxx";
@@ -23,7 +24,7 @@ Toolchain::Tool::Tool() {
Toolchain::Tool::~Tool() {
}
-Toolchain::Toolchain(const Label& label) : Item(label) {
+Toolchain::Toolchain(const Label& label) : Item(label), is_default_(false) {
}
Toolchain::~Toolchain() {