← All tasks
cppfmtlib/fmt #3701Not a task: already works

CMake does not set PDB path for Visual Studio

envgap__fmtlib__fmt-3701

01 / FAILURE SIGNATURE

As reported upstream

No identifying execution failure has been captured.
Not a benchmark task.
  • The project already builds and runs before the fix, so there is nothing to repair.

02 / ENVIRONMENT RECIPE

Base commit
050d41e85760ea7d21de1d4d9fae16219365aa8e
Manifest
CMakeLists.txt
Reproduce
Awaiting issue-specific recipe
Run under trace
Awaiting a meaningful runtime command

03 / ORIGINAL ISSUE TEXT

fmtlib/fmt #3701 · read the original issue
The Visual Studio solution generated by CMake does not have [**Program Database File Name**](https://learn.microsoft.com/en-us/cpp/build/reference/fd-program-database-file-name?view=msvc-170) 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>`](https://cmake.org/cmake/help/latest/prop_tgt/COMPILE_PDB_OUTPUT_DIRECTORY_CONFIG.html) and [`COMPILE_PDB_NAME_<CONFIG>`](https://cmake.org/cmake/help/latest/prop_tgt/COMPILE_PDB_NAME_CONFIG.html).
Continue on GitHub ↗

04 / LABELS

Labels from the report text only; not yet run

No supported category has been assigned.

Label rules and the text that matched
[]