[cmake-developers] Severe regression caused by #14972 fixes

Brad King brad.king at kitware.com
Wed Oct 8 09:16:03 EDT 2014


On 10/07/2014 04:53 PM, Adam Strzelecki wrote:
> In meantime I've pushed stage/cmp0055-disable-ninja-side-effects
> that make CMake warn about this compatibility layer when such
> phony rules are about to be emitted.

What I've been trying to say is that this is NOT about compatibility
with broken projects.  It is a *fundamental limitation* of the current
CMake custom command specification interface (add_custom_command).
If you start requiring explicit specification of side-effects as
custom command outputs, you will make it *impossible* for project code
to specify their build rules for cases involving side-effect outputs
whose timestamps do not need to be newer than their inputs.  Non-Ninja
build systems do *not* support this.  This issue:

 Add explicit specification of custom command side effect outputs
 http://www.cmake.org/Bug/view.php?id=14963

documents a few such cases.  It explains that we need a new interface,
perhaps as an option to add_custom_command, to specify side-effect
outputs of rules.

Another possible middle-ground workaround is to generate phony rules
only for custom command dependencies that are marked with the
GENERATED property.  That would avoid the phony rule bloat and
simply require projects to explicitly mark their generated side
effects.  We still won't be able to tell Ninja which rule generates
them, but at least we could reduce the number of phony rules.
However, there is no way this will be done for 3.1 by tomorrow,
so it would be best to think about a full solution to #14963 to
start development now and target the 3.2 release.

-Brad




More information about the cmake-developers mailing list