MantisBT - CMake
View Issue Details
0014667CMake(No Category)public2013-12-23 08:072014-10-06 10:33
njeisecke 
Brad King 
normalminorhave not tried
closedfixed 
WindowsWindows7
CMake 2.8.12 
CMake 2.8.12.2CMake 2.8.12.2 
0014667: MSVC compiler PDB change breaks PCH support (with minimal testcase)
The change http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=42ba1b08 [^] added a compiler switch "/Fd<OBJECT_DIR>".

When using precompiled headers this will now cause errors like:

C:\projects\cmakepch\subdir\test2.cpp(1) : error C2859: c:\projects\cmakepch\build\cmakefiles\test.dir\subdir\vc90.pdb is not the pdb file that was used when this precompiled header was created, recreate the precompiled header.

This occurs for all source files not on the same level as the compiled header object file because msvc is now told to use the pdb in the object directory.

Explicitly setting /Fd does not help because that's overridden by cmake.
please check the attached minimal testcase.
works in 2.8.10.2 but not in 2.8.12.
No tags attached.
related to 0014876closed Kitware Robot Improve support for TI compiler 
zip cmakepch.zip (4,593) 2013-12-23 08:07
https://public.kitware.com/Bug/file/5026/cmakepch.zip
Issue History
2013-12-23 08:07njeiseckeNew Issue
2013-12-23 08:07njeiseckeFile Added: cmakepch.zip
2013-12-23 10:04Brad KingNote Added: 0034856
2013-12-23 10:04Brad KingAssigned To => Brad King
2013-12-23 10:04Brad KingStatusnew => resolved
2013-12-23 10:04Brad KingResolutionopen => fixed
2013-12-23 10:04Brad KingFixed in Version => CMake 2.8.12.2
2013-12-23 10:04Brad KingTarget Version => CMake 2.8.12.2
2013-12-23 10:05Brad KingNote Edited: 0034856bug_revision_view_page.php?bugnote_id=34856#r1347
2014-01-02 13:49Brad KingNote Edited: 0034856bug_revision_view_page.php?bugnote_id=34856#r1356
2014-04-15 08:45Brad KingRelationship addedrelated to 0014876
2014-10-06 10:33Robert MaynardNote Added: 0036973
2014-10-06 10:33Robert MaynardStatusresolved => closed

Notes
(0034856)
Brad King   
2013-12-23 10:04   
(edited on: 2014-01-02 13:49)
Thanks for the clear report and explanation of this regression.

The problem is that the <OBJECT_DIR> replacement is supposed to point at a single intermediate files directory for all objects in a target but for compile lines it instead points to the directory containing the current object file. This should fix it:

 Replace <OBJECT_DIR> rule placeholder consistently
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=03f3b4e7 [^]

With the consistent replacement then the same compiler program database (vc90.pdb) location should be used for all compilations in a single target.

(0036973)
Robert Maynard   
2014-10-06 10:33   
Closing resolved issues that have not been updated in more than 4 months.