Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(75)

Issue 26561005: GYP generator for GN (Closed)

Created:
7 years, 2 months ago by brettw
Modified:
7 years, 2 months ago
Reviewers:
Evan Martin, scottmg
CC:
chromium-reviews
Visibility:
Public.

Description

GYP generator for GN. This creates a GYP generator for GN. The GN build is run twice, once for debug and once for release mode. The resulting targets are paired to find the debug/release version of each one, and we write out the results as a GYP file. Since a GN build can change anything based on the debug/release status, including changing the file list, and GYP can't there are a bunch of checks to make sure that the source files and deps don't vary between the debug and release version of the same target. I split the Setup class apart so I can make duplicate Setup classes base on an original one (I use this to configure a release build based on the debug one). I added some copy constructors to the necessary classes so this would work. This reads in the GYP_DEFINES and configures the GN build in the same way. The mapping between GYP_DEFINES and gl flags is hardcoded. I had to write some parsing code for the GYP_DEFINES which is unfortunate. I added a new GN variable "gyp_file" for targets to set the GYP file that they should be written to. I added a parameter for the Windows SDK path that matches the GYP build. This removes the old "GYP" command. I commented out all of the grit rules. These aren't helping anything right now and just slow down testing. BUG=307571 R=scottmg@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=228933

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : non-component build works #

Patch Set 4 : #

Patch Set 5 : #

Patch Set 6 : #

Patch Set 7 : #

Total comments: 14

Patch Set 8 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1203 lines, -505 lines) Patch
M tools/gn/BUILD.gn View 1 2 3 4 5 6 2 chunks +12 lines, -0 lines 0 comments Download
M tools/gn/args.h View 1 2 3 4 2 chunks +3 lines, -1 line 0 comments Download
M tools/gn/args.cc View 1 2 3 4 1 chunk +13 lines, -2 lines 0 comments Download
M tools/gn/build_settings.h View 1 2 3 4 5 6 4 chunks +2 lines, -15 lines 0 comments Download
M tools/gn/build_settings.cc View 1 2 3 4 5 6 1 chunk +16 lines, -0 lines 0 comments Download
M tools/gn/command_gyp.cc View 1 2 3 4 5 6 7 2 chunks +251 lines, -298 lines 0 comments Download
M tools/gn/escape.h View 1 chunk +3 lines, -1 line 0 comments Download
M tools/gn/escape.cc View 2 chunks +6 lines, -0 lines 0 comments Download
M tools/gn/gn.gyp View 1 2 3 4 5 6 1 chunk +6 lines, -0 lines 0 comments Download
A tools/gn/gyp_binary_target_writer.h View 1 2 3 4 1 chunk +47 lines, -0 lines 0 comments Download
A tools/gn/gyp_binary_target_writer.cc View 1 2 3 4 1 chunk +291 lines, -0 lines 0 comments Download
A tools/gn/gyp_helper.h View 1 2 3 4 1 chunk +41 lines, -0 lines 0 comments Download
A tools/gn/gyp_helper.cc View 1 2 1 chunk +105 lines, -0 lines 0 comments Download
A tools/gn/gyp_target_writer.h View 1 2 3 4 1 chunk +47 lines, -0 lines 0 comments Download
A tools/gn/gyp_target_writer.cc View 1 2 3 4 1 chunk +69 lines, -0 lines 0 comments Download
M tools/gn/ninja_binary_target_writer.cc View 1 2 3 4 5 6 1 chunk +0 lines, -11 lines 0 comments Download
M tools/gn/ninja_build_writer.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M tools/gn/ninja_target_writer.cc View 1 chunk +0 lines, -7 lines 0 comments Download
M tools/gn/secondary/BUILD.gn View 1 chunk +2 lines, -0 lines 0 comments Download
M tools/gn/secondary/build/config/BUILDCONFIG.gn View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M tools/gn/secondary/build/config/win/BUILD.gn View 1 2 3 4 5 3 chunks +8 lines, -6 lines 0 comments Download
M tools/gn/secondary/chrome/BUILD.gn View 1 2 3 4 2 chunks +106 lines, -106 lines 0 comments Download
M tools/gn/secondary/net/BUILD.gn View 1 2 3 4 2 chunks +5 lines, -5 lines 0 comments Download
M tools/gn/secondary/testing/BUILD.gn View 2 3 chunks +3 lines, -0 lines 0 comments Download
M tools/gn/setup.h View 1 2 3 4 3 chunks +56 lines, -11 lines 0 comments Download
M tools/gn/setup.cc View 1 2 3 4 3 chunks +68 lines, -27 lines 0 comments Download
M tools/gn/source_dir.cc View 1 chunk +6 lines, -1 line 0 comments Download
M tools/gn/source_file.cc View 1 chunk +7 lines, -11 lines 0 comments Download
M tools/gn/target.h View 2 chunks +4 lines, -1 line 0 comments Download
M tools/gn/target_generator.h View 1 chunk +1 line, -0 lines 0 comments Download
M tools/gn/target_generator.cc View 2 chunks +12 lines, -0 lines 0 comments Download
M tools/gn/variables.h View 1 chunk +4 lines, -0 lines 0 comments Download
M tools/gn/variables.cc View 2 chunks +7 lines, -0 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
brettw
7 years, 2 months ago (2013-10-15 16:49:33 UTC) #1
brettw
The GYP side change is https://codereview.chromium.org/27353003/
7 years, 2 months ago (2013-10-15 17:03:15 UTC) #2
Evan Martin
https://codereview.chromium.org/26561005/diff/14001/tools/gn/source_dir.cc File tools/gn/source_dir.cc (right): https://codereview.chromium.org/26561005/diff/14001/tools/gn/source_dir.cc#newcode121 tools/gn/source_dir.cc:121: converted.assign(&value_[1], value_.size() - 1); converted = value_.substr(1);
7 years, 2 months ago (2013-10-15 19:19:10 UTC) #3
scottmg
A bit too huge to have much useful feedback, but rough lgtm anyway. https://codereview.chromium.org/26561005/diff/14001/tools/gn/args.h File ...
7 years, 2 months ago (2013-10-15 19:58:21 UTC) #4
brettw
https://codereview.chromium.org/26561005/diff/14001/tools/gn/source_dir.cc File tools/gn/source_dir.cc (right): https://codereview.chromium.org/26561005/diff/14001/tools/gn/source_dir.cc#newcode121 tools/gn/source_dir.cc:121: converted.assign(&value_[1], value_.size() - 1); On 2013/10/15 19:19:10, Evan Martin ...
7 years, 2 months ago (2013-10-15 20:18:00 UTC) #5
Evan Martin
On 2013/10/15 20:18:00, brettw wrote: > https://codereview.chromium.org/26561005/diff/14001/tools/gn/source_dir.cc > File tools/gn/source_dir.cc (right): > > https://codereview.chromium.org/26561005/diff/14001/tools/gn/source_dir.cc#newcode121 > ...
7 years, 2 months ago (2013-10-15 20:31:54 UTC) #6
brettw
https://codereview.chromium.org/26561005/diff/14001/tools/gn/args.h File tools/gn/args.h (right): https://codereview.chromium.org/26561005/diff/14001/tools/gn/args.h#newcode87 tools/gn/args.h:87: Args& operator=(const Args& other); // Disallow assignment. Yes, Google ...
7 years, 2 months ago (2013-10-15 21:18:05 UTC) #7
scottmg
https://codereview.chromium.org/26561005/diff/14001/tools/gn/args.h File tools/gn/args.h (right): https://codereview.chromium.org/26561005/diff/14001/tools/gn/args.h#newcode87 tools/gn/args.h:87: Args& operator=(const Args& other); // Disallow assignment. On 2013/10/15 ...
7 years, 2 months ago (2013-10-15 21:19:54 UTC) #8
brettw
7 years, 2 months ago (2013-10-16 17:36:04 UTC) #9
Message was sent while issue was closed.
Committed patchset #8 manually as r228933 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698