Skip to content

CMake does not set PDB path for Visual Studio #3701

Closed
@pklima

Description

@pklima

The Visual Studio solution generated by CMake does not have Program Database File Name set.

This means that the default is used. In VS2022 and VS2019 this ends up working out because the default is $(OutDir)$(TargetName).pdb, but in VS2017 the default is the far more unfortunate $(IntDir)$(ProjectName).pdb, meaning the file is output in the wrong directory, and in Debug also with the wrong name (fmt.dir\Debug\fmt.pdb instead of Debug\fmtd.pdb).

I would expect that the property is set so that the .pdb always ends up next to the .lib with the same name, i.e.:

  • In Debug: fmtd.lib + fmtd.pdb
  • In RelWithDebInfo: fmt.lib + fmt.pdb

It seems that the relevant CMake properties are COMPILE_PDB_OUTPUT_DIRECTORY_<CONFIG> and COMPILE_PDB_NAME_<CONFIG>.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions