Skip to content
  • Brad King's avatar
    Add an option for explicit BYPRODUCTS of custom commands (#14963) · e15a7075
    Brad King authored
    A common idiom in CMake-based build systems is to have custom commands
    that generate files not listed explicitly as outputs so that these
    files do not have to be newer than the inputs.  The file modification
    times of such "byproducts" are updated only when their content changes.
    Then other build rules can depend on the byproducts explicitly so that
    their dependents rebuild when the content of the original byproducts
    really does change.
    
    This "undeclared byproduct" approach is necessary for Makefile, VS, and
    Xcode build tools because if a byproduct were listed as an output of a
    rule then the rule would always rerun when the input is newer than the
    byproduct but the byproduct may never be updated.
    
    Ninja solves this problem by offering a 'restat' feature to check
    whether an output was really modified after running a rule and tracking
    the fact that it is up to date separately from its timestamp.  However,
    Ninja also stats all dependencies up f...
    e15a7075