Add a test to expose a bug with add_custom_command and ninja.

Ninja Generator is unable to handle an add_custom_command having
a dependency that is generated at build time by a previous target.
Ninja Custom Command file depends don't need to exist before building

When converting custom commands for the ninja build system we
need to make sure that any file dependencies that exist in the build
tree are converted to phony targets. This tells ninja that these
files might not exist when starting the build, but could be generated
during the build.

This is done by tracking all dependencies for custom command targets.
After all have been written out we remove all items from the set
that have been seen as a; target, custom command output, an alias,
or a file in the source directory. Anything that is left is considered
to be a file that will be generated as a side effect of another
custom command.
Merge topic 'ninja_phony_file_targets' into next

ba0732a Ninja Custom Command file depends don't need to exist before building
92e82b8 Add a test to expose a bug with add_custom_command and ninja.