Closed vslavik closed 2 years ago
Sorry, I remember now why I've used my own custom build step even for MSVS: with just
if ( $config == Release ) {
sources { foo.xrc }
}
MSVS thinks the file needs to be rebuilt every time foo.xrc
is modified even in Debug configuration. This seems logical: the generated file foo.cpp
is excluded from build, but foo.xrc
itself isn't, so it still wants to run the custom build step. IOW we need ExcludedFromBuild
in CustomBuild
itself, not only in ClCompile
node.
(there is also a cosmetic issue of using foo.cpp
as the name of the file generated from foo.xrc
, which is not ideal as it can clash with an existing foo.cpp
, but changing it to foo_xrc.cpp
should be trivial and I could do it myself if you don't mind).
IOW we need ExcludedFromBuild in CustomBuild itself, not only in ClCompile node.
Makes sense to me.
(there is also a cosmetic issue of using foo.cpp as the name of the file generated from foo.xrc, which is not ideal as it can clash with an existing foo.cpp, but changing it to foo_xrc.cpp should be trivial and I could do it myself if you don't mind
There already is code that is supposed to handle this sanely, see disambiguate_intermediate_file_names
if you don't mind
Feel free to push whatever here.
Outdated by #131
See #124.
07acb7c allows constructs like this in makefiles too: