(6) Ninja eventually tries to link the resulting .so and this fails because the .so path is relative in rules.ninja and the output folder doesn't exist relative to the current directory.
A common theme of the machines this repros on seems to be that they run a non-US-English Windows. There has to be more to it though because I tried that myself and still didn't repro. A theory I had was that CMakeCache.txt is written in some encoding that loses information in the presence of Unicode characters. I tried this and it didn't seem to pan out.
Mainly I'd like to see if anyone has ideas that would help me reproduce the issue and also whether you suspect it may be fixed in versions of CMake after 3.6.