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

Tom Kacvinsky tom.kacvinsky at vectorcast.com
Tue Sep 22 09:25:07 EDT 2015


On Mon, Sep 21, 2015 at 5:37 PM, Tom Kacvinsky <tom.kacvinsky at vectorcast.com
> wrote:

> I am using cmake 2.8.11.2 on Windows 7 with Visual Studio 2008
>
> This is the snipped of my CMakeLists.txt file
>
>   add_library(commoncpp_objects
>     OBJECT
>      <srcs>
>   )
>
>   add_library(commoncpp_static STATIC $<TARGET_OBJECTS:commoncpp_objects>)
>   add_dependencies(commoncpp_static commoncpp_objects)
>
> add_library(commoncpp SHARED
>   $<TARGET_OBJECTS:commoncpp_objects>
>   commoncpp_exports.def
> )
>
> The objects, static library, and dll/import lib/exp files are created, but
> there is no commoncpp.pdb file.
>
> Any ideas what I am doing wrong?
>

I think this is a bug.  If I list the object files ia the generator, the
PDB file is not created, but if I list the sources and force them to be
compiled, then the PDB is created.  Please note whether listing the object
files or compiling from source, there is the cl option to create PDB
debugging information.  That is, the object files were created that way,
regardless of how I listed the files to the add_library.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20150922/de01af44/attachment.html>


More information about the CMake mailing list