[CMake] add_library(foo SHARED...) is not creating a PDB file

Tom Kacvinsky tom.kacvinsky at vectorcast.com
Tue Sep 22 11:16:37 EDT 2015


On Tue, Sep 22, 2015 at 9:57 AM, Tom Kacvinsky <tom.kacvinsky at vectorcast.com
> wrote:

>
>
> On Tue, Sep 22, 2015 at 9:41 AM, Brad King <brad.king at kitware.com> wrote:
>
>> On 09/22/2015 09:25 AM, Tom Kacvinsky wrote:
>> > I am using cmake 2.8.11.2 on Windows 7 with Visual Studio 2008
>> [snip]
>> > whether listing the object files or compiling from source, there is
>> > the cl option to create PDB debugging information.
>>
>> Please try with CMake 3.1 or higher:
>>
>>  http://www.cmake.org/Bug/view.php?id=14763
>>
>> There is a distinction between compiler-generated and linker-generated
>> .pdb files.  See these target properties to configure each:
>>
>>  http://www.cmake.org/cmake/help/v3.3/prop_tgt/COMPILE_PDB_NAME.html
>>
>> http://www.cmake.org/cmake/help/v3.3/prop_tgt/COMPILE_PDB_OUTPUT_DIRECTORY.html
>>  http://www.cmake.org/cmake/help/v3.3/prop_tgt/PDB_NAME.html
>>  http://www.cmake.org/cmake/help/v3.3/prop_tgt/PDB_OUTPUT_DIRECTORY.html
>>
>
> I will give 3.3.2 a try.  In the meantime, I am getting a PDB file by
> listing the source files for the add_library(commoncpp SHARED <srcs> <def
> file>), but when I run in the visual studio debugger, it says there are no
> symbols loaded for the DLL.  The PDB path recorded in the DLL points to the
> right PDB file, but the PDB file typically is larger than the DLL. but in
> this case it is not.  Is that because I am not getting all of the debug
> information, and a later version of cmake will guarantee that we get the
> right information?
>
> Ah yes, I was doing a release build, so link was not invoked with /debug.
No wonder my PDB files were so small. For the moment, I just manually
created the debug PDB so I can debug my application.  Right now, having two
builds (debug and release) doesn't fit our workflow, so that will have to
be considered.

Thanks for the help, Brad.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20150922/07a20b9b/attachment-0001.html>


More information about the CMake mailing list