-
- Downloads
configure_file: canonicalize input and output path in dependencies
Represent the input file path internally in canonical form. Otherwise multiple `configure_file` calls that share the same input file but specify it relative to different directories (e.g. via `../`) result in multiple copies of the dependency on the rule to re-run CMake. This causes the Ninja generator to emit duplicate phony build statements for these dependencies, which generates an error with `-w dupbuild=err`, which will be default in Ninja 1.9. Also canonicalize the output path for consistency. Add a test case. Fixes: #18584
Showing
- Source/cmConfigureFileCommand.cxx 4 additions, 10 deletionsSource/cmConfigureFileCommand.cxx
- Tests/RunCMake/Ninja/PreventConfigureFileDupBuildRule.cmake 5 additions, 0 deletionsTests/RunCMake/Ninja/PreventConfigureFileDupBuildRule.cmake
- Tests/RunCMake/Ninja/RunCMakeTest.cmake 7 additions, 0 deletionsTests/RunCMake/Ninja/RunCMakeTest.cmake
- Tests/RunCMake/Ninja/SubDirConfigureFileDup/CMakeLists.txt 1 addition, 0 deletionsTests/RunCMake/Ninja/SubDirConfigureFileDup/CMakeLists.txt
- Tests/RunCMake/configure_file/DirInput-stderr.txt 1 addition, 1 deletionTests/RunCMake/configure_file/DirInput-stderr.txt
Please register or sign in to comment