[CMake] CMakeCache changing due to PDB

Brad King brad.king at kitware.com
Sat Aug 1 08:44:50 EDT 2009


Ashwin Chandra wrote:
> Notice the pdb file changed in case. I think what is happening is that 
> the compiler is generating the pdb file in all lower case on the first 
> build run and when doing a second build run, it somehow knows the file 
> is in lowercase now and it updates the build.make files (which in turn 
> tells cmake and visual studio compiler to do the linking phase over 
> again).  Note that a third or more builds work fine (no relinking).

Good analysis.

> Is there anyway to have the build.make file always generate the pdb 
> section in lowercase? Where does it get the case of the file anyway?

CMake generates the rules using the case of the logical target name.
However, most paths that CMake processes on Windows go through a
"get actual case" function which tries to preserve the case of the
file as seen on disk.  The first time the file doesn't exist, so
CMake just uses the case it intends.  The second time the file does
exist, so the "get actual case" works and switches the case.

It's kind of the compiler's fault for not preserving the case it
is given in the /Fd option, but it is up to CMake to deal with it.
We'll have to be more careful about which paths go through the
"get actual case" function.  Only files that are inputs to the
build should go through it, while files generated by the build
should not.  Please submit this here:

http://www.cmake.org/Bug

Thanks,
-Brad


More information about the CMake mailing list