DescriptionIntegrate 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 #
Messages
Total messages: 24 (0 generated)
|