I'd like to raise the issue of supporting msvs_prebuild and
msvs_postbuild in the MSBuild-based generator again.
Our build system currently generates only VS 2008 project files, and it
uses msvs_prebuild and msvs_postbuild; this is working well for us. We
can't easily switch to VS 2010 or 2013 because msvs_prebuild and
msvs_postbuild are not supported there.
This has been discussed before, e.g. here:
<
https://groups.google.com/d/msg/gyp-developer/GGQj0YsP148/25j4Gb1Da0wJ>
The consensus seems to be that prebuilds and postbuilds are bad, and
actions should be used instead. However, in our case actions are not a
viable substitute, as far as I can see:
1) For the prebuild-steps, our requirement is that they only run when a
target gets built. We have a long dependency chain of dependent
targets, and when making a change to a target close to the end of the
chain, it's important that only that target and its dependents have
their prebuild steps run; otherwise, do-nothing builds would be much
too slow. I don't see how to achieve this with actions.
2) Our postbuild step needs to run after the target is linked, so an
action doesn't work (it runs before the target's source files are
compiled, see
<
http://msdn.microsoft.com/en-us/library/e85wte0k.aspx>). The perfect
solution for us would be a custom build step on the project, but gyp
doesn't seem to support these, as far as I can see. A post-build
event is the next best solution, then.
The suggestion to solve this with an action in a dependent none-type
target doesn't work well, because setting that target as the StartUp
Project in Visual Studio requires extra configuration; and in Xcode
there's no way at all to debug such a target. (Again, the 'postbuild'
feature of the Xcode generator solves this perfectly for us.)
In short, my plea would be to accept the patch from
<
https://codereview.chromium.org/8229003/>. We are doing this locally,
and it solves all our problems; I'm just worried that it might break in
the future.
Thanks,
Stefan
--
Stefan Haller
Berlin, Germany
http://www.haller-berlin.de/