Ninja generator creates duplicate phony dependency when using configure file from different directories
Given CMakeLists.txt
:
cmake_minimum_required(VERSION 3.10)
project(Test NONE)
configure_file(a a @ONLY)
add_subdirectory(s)
And s/CMakeLists.txt
:
configure_file(../a a @ONLY)
And an empty file a
.
The Ninja generator creates the following phony
edge:
build ../CMakeLists.txt ../a ../s/../a ../s/CMakeLists.txt <system cmake modules>: phony
Current released Ninja version (1.8.2) outputs this warning:
ninja: warning: multiple rules generate ../a. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
In Ninja's master branch a commit was introduced which makes this an error by default:
ninja: error: build.ninja:112: multiple rules generate ../a [-w dupbuild=err]