diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-29 21:06:26 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-29 21:06:26 +0000 |
commit | 0a79fe4b90ca24b1e5ac78f15991ac4017f68b9d (patch) | |
tree | b6b9c5d1f7cfc99f1a4278c46f6fdbfd9e709977 /tools/gn/ninja_writer.h | |
parent | f796b33367f47be55d51a3fd8a19bad6a48b744b (diff) | |
download | chromium_src-0a79fe4b90ca24b1e5ac78f15991ac4017f68b9d.zip chromium_src-0a79fe4b90ca24b1e5ac78f15991ac4017f68b9d.tar.gz chromium_src-0a79fe4b90ca24b1e5ac78f15991ac4017f68b9d.tar.bz2 |
Add a GYP command to GN. This runs GYP and then GN, and does some work to integrate the builds.
Adds an "external" variable that's set in the GYP mode of GN that will cause it to not write out a target but to pretend it's there. These are the ones that should be generated by GYP. This value is not used in the normal "gen" mode so we actually have two builds: a separate GN-only build that includes GN itself and some other low-level libraries, and a hybrid build.
This renames and moves some of the GN targets so that the names and locations match those of the GYP build.
I prefixed the ninja rules for the default toolchain to avoid colliding with the GYP ones. I also fixed some places where the rules were not getting prefixed.
I added an exception to target output labeling to avoid double-prefixing with "lib".
TBR=scottmg
BUG=
Review URL: https://codereview.chromium.org/23493013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@220367 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/gn/ninja_writer.h')
-rw-r--r-- | tools/gn/ninja_writer.h | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/tools/gn/ninja_writer.h b/tools/gn/ninja_writer.h index a4050a8..c2efc92 100644 --- a/tools/gn/ninja_writer.h +++ b/tools/gn/ninja_writer.h @@ -5,20 +5,42 @@ #ifndef TOOLS_GN_NINJA_WRITER_H_ #define TOOLS_GN_NINJA_WRITER_H_ +#include <set> +#include <string> +#include <vector> + #include "base/basictypes.h" class BuildSettings; +class Settings; +class Target; class NinjaWriter { public: // On failure will print an error and will return false. static bool RunAndWriteFiles(const BuildSettings* build_settings); + // Writes only the toolchain.ninja files, skipping the root buildfile. The + // settings for the files written will be added to the vector. + // + // The skip files will avoid writing "subninja" rules when we're doing a + // side-by-side GYP build. .ninja files exactly matching the ones in the set + // will be ignored. + static bool RunAndWriteToolchainFiles( + const BuildSettings* build_settings, + const std::set<std::string>& skip_files, + std::vector<const Settings*>* all_settings); + private: NinjaWriter(const BuildSettings* build_settings); ~NinjaWriter(); - bool WriteRootBuildfiles(); + bool WriteToolchains( + const std::set<std::string>& skip_files, + std::vector<const Settings*>* all_settings, + std::vector<const Target*>* default_targets); + bool WriteRootBuildfiles(const std::vector<const Settings*>& all_settings, + const std::vector<const Target*>& default_targets); const BuildSettings* build_settings_; |