Ninja PDB build rules not reproducible
I noticed some irreproducibilities in the build.ninja
files generated by cmake
when running from scratch and a cache. To reproduce use e.g. this trivial CMakeLists.txt
:
cmake_minimum_required(VERSION 3.10)
project(Test)
add_executable(Test test.cxx)
Then run (on Linux, cmake 3.22.20211221-g6afe949
):
cmake -GNinja .
cp build.ninja build.ninja.1
cmake -GNinja .
diff build.ninja.1 build.ninja
and you will see amongst some other changes:
51,52d50
< TARGET_COMPILE_PDB = CMakeFiles/Test.dir/
< TARGET_PDB = Test.pdb
66d63
< TARGET_COMPILE_PDB = CMakeFiles/Test.dir/
68c65
< TARGET_PDB = Test.pdb
---
> TARGET_PDB = Test.dbg
If you run it a third time you will get the same result as for the 2nd run.
I am not sure this is actually a problem, but it seems odd we are getting different build rules. Of course, since this is on Linux I suppose none of this actually impacts the build. Which leads me to the question, why are these PDB targets even created in the first place on this platform?