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

Issue 13867004: Integrate ninja build with Visual Studio (Closed)

Created:
7 years, 8 months ago by Shezan Baig (Bloomberg)
Modified:
7 years, 8 months ago
Reviewers:
Dirk Pranke, scottmg
CC:
gyp-developer_googlegroups.com
Base URL:
https://chromium.googlesource.com/external/gyp.git@master
Visibility:
Public.

Description

Integrate ninja build with Visual Studio This change allows plugging in external builders to the msvs projects. This is activated by defining the following flags in target_defaults: * msvs_external_builder * msvs_external_builder_out_dir * msvs_external_builder_build_cmd * msvs_external_builder_clean_cmd When msvs_external_builder is defined for a gyp target, the following changes are made to the generated msvs project: * The project will use the provided msvs_external_builder_build_cmd to build the project, and also use the provided msvs_external_builder_clean_cmd to clean the project. * No dependencies between projects will be created. This is because we want to use ninja's dependency build instead. * The build output directory will be msvs_external_builder_out_dir instead of 'src/build/$(Configuration)'. * MSBuild rules and actions will not be generated. This is because we want the external builder to perform these actions instead. This change has no effect if the 'msvs_external_builder' variable is not used (or if it is an empty string). Some caveats of these mode are: * The 'Build/Clean Solution' commands in Visual Studio cannot be used, because this will invoke a separate external builder instance for each project in the solution. * Hitting F5 in Visual Studio always prompts to build, claiming that the build target is out of date, even if it was just built. Test: Define the following variables in target_defaults: 'msvs_external_builder': 'ninja', 'msvs_external_builder_out_dir': '<(DEPTH)/out/$(Configuration)', 'msvs_external_builder_build_cmd': [ 'ninja.exe', '-C', '$(OutDir)', '$(ProjectName)', ], 'msvs_external_builder_clean_cmd': [ 'ninja.exe', '-C', '$(OutDir)', '-t', 'clean', '$(ProjectName)', ], Alternatively, export "GYP_GENERATORS=msvs-ninja". This will automatically setup msvs to build with ninja. Then run "gclient runhooks" to generate your projects. Open the generated solution. Right-click on any project and click the 'Build' menu item. The output window will show the ninja build in progress. Patch by sbaig1@bloomberg.net R=dpranke@chromium.org, scottmg@chromium.org BUG= Committed: https://code.google.com/p/gyp/source/detail?r=1618

Patch Set 1 #

Patch Set 2 : Fixed build target names #

Total comments: 10

Patch Set 3 : Simplified patch incorporating review comments #

Patch Set 4 : added tests and msvs-ninja flavor #

Total comments: 5

Patch Set 5 : with review comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+251 lines, -59 lines) Patch
M pylib/gyp/generator/msvs.py View 1 2 3 4 7 chunks +105 lines, -14 lines 0 comments Download
M test/lib/TestGyp.py View 1 2 3 1 chunk +4 lines, -2 lines 0 comments Download
A test/msvs/external_builder/external.gyp View 1 2 3 4 1 chunk +68 lines, -0 lines 0 comments Download
A + test/msvs/external_builder/external_builder.py View 1 2 3 4 1 chunk +5 lines, -11 lines 0 comments Download
A test/msvs/external_builder/gyptest-all.py View 1 2 3 4 1 chunk +56 lines, -0 lines 0 comments Download
A + test/msvs/external_builder/hello.cpp View 1 2 3 0 chunks +-1 lines, --1 lines 0 comments Download
A + test/msvs/external_builder/hello.z View 1 2 3 4 1 chunk +2 lines, -11 lines 0 comments Download
A + test/msvs/external_builder/msbuild_action.py View 1 2 3 4 1 chunk +5 lines, -11 lines 0 comments Download
A + test/msvs/external_builder/msbuild_rule.py View 1 2 3 4 1 chunk +7 lines, -11 lines 0 comments Download

Messages

Total messages: 24 (0 generated)
scottmg
""" * Hitting F5 in Visual Studio always prompts to build, claiming that the build ...
7 years, 8 months ago (2013-04-15 19:25:59 UTC) #1
scottmg
(We'll need to think of a way to do at least basic testing around msvs_external_builder ...
7 years, 8 months ago (2013-04-15 19:27:07 UTC) #2
scottmg
i'm not very familiar with the msvs generator but this looks fairly reasonable. https://codereview.chromium.org/13867004/diff/2001/pylib/gyp/generator/msvs.py File ...
7 years, 8 months ago (2013-04-15 19:37:58 UTC) #3
Shezan Baig (Bloomberg)
On 2013/04/15 19:25:59, scottmg wrote: > Is it not possible to specify the outputs for ...
7 years, 8 months ago (2013-04-15 19:39:53 UTC) #4
Dirk Pranke
I don't have much msvs-wizardry to offer, so I defer to scottmg on that. I've ...
7 years, 8 months ago (2013-04-16 00:41:03 UTC) #5
Shezan Baig (Bloomberg)
Thanks for all the review comments. I've redone the patch to be more generic, and ...
7 years, 8 months ago (2013-04-16 16:01:39 UTC) #6
scottmg
This looks good! We need a test though. Now that the setup isn't ninja-specific it ...
7 years, 8 months ago (2013-04-16 17:23:49 UTC) #7
Dirk Pranke
I like the idea that you've pulled all of the ninja-specific stuff out of the ...
7 years, 8 months ago (2013-04-16 17:28:28 UTC) #8
Shezan Baig (Bloomberg)
On 2013/04/16 17:23:49, scottmg wrote: > This looks good! > > We need a test ...
7 years, 8 months ago (2013-04-16 17:54:57 UTC) #9
Shezan Baig (Bloomberg)
On 2013/04/16 17:28:28, Dirk Pranke wrote: > I like the idea that you've pulled all ...
7 years, 8 months ago (2013-04-16 17:57:49 UTC) #10
Dirk Pranke
On 2013/04/16 17:57:49, Shezan Baig (Bloomberg) wrote: > On 2013/04/16 17:28:28, Dirk Pranke wrote: > ...
7 years, 8 months ago (2013-04-16 18:01:02 UTC) #11
scottmg
On 2013/04/16 18:01:02, Dirk Pranke wrote: > On 2013/04/16 17:57:49, Shezan Baig (Bloomberg) wrote: > ...
7 years, 8 months ago (2013-04-16 18:02:53 UTC) #12
Dirk Pranke
On 2013/04/16 18:02:53, scottmg wrote: > On 2013/04/16 18:01:02, Dirk Pranke wrote: > > On ...
7 years, 8 months ago (2013-04-16 19:00:06 UTC) #13
Shezan Baig (Bloomberg)
On 2013/04/16 19:00:06, Dirk Pranke wrote: > Okay. Maybe we land this patch as-is and ...
7 years, 8 months ago (2013-04-16 19:02:44 UTC) #14
Shezan Baig (Bloomberg)
The latest patch includes tests, and now supports running gyp with GYP_GENERATORS=msvs-ninja When using the ...
7 years, 8 months ago (2013-04-16 22:24:43 UTC) #15
scottmg
lgtm mod copyright and nits. Dirk, do you have any idea on copyright? A grep ...
7 years, 8 months ago (2013-04-16 22:48:00 UTC) #16
Dirk Pranke
On 2013/04/16 22:48:00, scottmg wrote: > lgtm mod copyright and nits. > > Dirk, do ...
7 years, 8 months ago (2013-04-16 22:49:55 UTC) #17
Dirk Pranke
On 2013/04/16 22:49:55, Dirk Pranke wrote: > On 2013/04/16 22:48:00, scottmg wrote: > > lgtm ...
7 years, 8 months ago (2013-04-17 01:36:11 UTC) #18
Shezan Baig (Bloomberg)
Thanks! I've updated the copyright info and also the nits. Also, note that this should ...
7 years, 8 months ago (2013-04-17 11:24:44 UTC) #19
Dirk Pranke
On 2013/04/17 11:24:44, Shezan Baig (Bloomberg) wrote: > Thanks! I've updated the copyright info and ...
7 years, 8 months ago (2013-04-19 19:26:06 UTC) #20
iannucci
FYI, I think some of the MSVS UI deficiencies can be worked around with macros ...
7 years, 8 months ago (2013-04-23 16:39:37 UTC) #21
Shezan Baig (Bloomberg)
On 2013/04/23 16:39:37, iannucci wrote: > FYI, I think some of the MSVS UI deficiencies ...
7 years, 8 months ago (2013-04-23 16:47:45 UTC) #22
scottmg
Committed patchset #5 manually as r1618.
7 years, 8 months ago (2013-04-24 19:18:36 UTC) #23
scottmg
7 years, 8 months ago (2013-04-24 19:20:22 UTC) #24
Message was sent while issue was closed.
On 2013/04/24 19:18:36, scottmg wrote:
> Committed patchset #5 manually as r1618.

and r1619. Can't roll into Chromium yet pending me fixing the ninja generator.

Powered by Google App Engine
This is Rietveld 408576698