AUTOGEN (AUTOMOC, AUTORCC) results in duplicate builds with Ninja + Clang
Since upgrading from CMake 3.8.2 to 3.9.2, my incremental builds recompiles much more than necessary. After many tests, I have isolated the issue to a specific configuration: Ninja combined with Clang. Ninja/Unix Makefiles with GCC work fine. Addition of ccache has no positive/negative effect. Having
CMAKE_AUTOMOC=ON is required to trigger the problem.
- Grab the test case from #17161 (closed) (but rename
example.qrcdue to a case-sensitive filesystem). It is important to have
cmake -GNinja -DCMAKE_CXX_COMPILER=clang++ ../Src
ninja -v(cold build)
ninja -v(incremental build)
Expected result: Step four should show not show the compile command.
Actual result: Step four recompiles the object file.
- Distribution: Arch Linux
- ninja 1.8.1-1
- cmake 3.9.2-2
- gcc-multilib 7.2.01-1
- clang 4.0.1-5