AUTOUIC: CMake compiles unchanged source files when a `.ui` file is touched with Ninja
If a .ui
file is touched in a project with multiple .ui
files added, cmake
builds all source files dependent on a .ui
file as if all .ui
files are touched.
This problem occurs when Ninja
is used as the generator. It doesn't occur when make
is selected.
How to reproduce
After building the example project with Ninja
, run the below command
cmake -E touch src/widget1.ui && cmake --build build --verbose && cmake --build build --verbose
It will recompile mainwindow.cpp
and widget2.cpp
although only widget1.ui
was touched.
Expected behavior
Only source files dependent on the touched .ui
files should be recompiled.
Edited by Orkun Tokdemir