Open Adnn opened 2 years ago
Note that this is the same issue than described in: https://github.com/bincrafters/community/issues/126
I think I will propose a PR to naively copy over the PDB, unless advised otherwise.
Very interesting, thank you @SpaceIm.
On the other hand, would that be okay to patch the project (via a recipe patch) to use /Z7
?
I don't think so, it can be injected externally.
Thank you for your response.
If I understand correctly, this means the default (i.e. without the user taking explicit steps to provide /Z7
) would be to always have a linker warning when consuming glfw
recipe on Windows with MSVC Degub builds.
Moreover, it seems uncommon for a consumer to request a debug build while not being interested in having the symbols for said build (making actual debugging much more difficult). I am not saying there are not legitimate cases for this, but making it the default assumption does not sound like the most user friendly option to me.
The goal is to allow you to debug your application... it's pretty rare you need to step into the code of ur dependencies. (in a perfect code you would never need to).
The warning is annoying but the overhead and cost of the PDBs are pretty considerable given they are a nice to have so we prioritized our resources, hopefully that makes sense. It's pretty easy to suppress the warning from a profile or cli.
In a perfect world, we would not debug applications ; )
Most other dependencies we tried are probably compiling with /Z7
, as we do not have warnings when linking in debug. I was surprised that neither embedding the pdb nor patching glfw
from the recipe to compile with /Z7
was considered a better alternative than a warning.
But that is not a hill I am willing to die on. I appreciate the feedback, and will have a local patch for the recipe.
@Adnn You can configure /Z7 directly from your profile, as Prince commented.
The global.conf has all supported configurations. Based on that, you can use tools.build:cflags
and tools.build:cxxflags
.
Description
When building glfw (tested v3.3.6 and v3.3.8) on Windows with MSVC compiler in
Debug
, theDebug Information Format
is\Zi
, thus producing a separate.pdb
file.When building the recipe locally, you can see that the
.pdb
is indeed present next toglfw3.lib
in thebuild
folder, but it is not exporter alongside in thepackage
folder.This causes linker waring when using
glfw3
as upstream:warning LNK4099: PDB 'glfw3.pdb' was not found with 'glfw3.lib(init.obj)' or at 'D:\projects\build-conan-Visual Studio16\src\apps\Debug\glfw3.pdb'; linking object as if no debug info
Package and Environment Details
Conan profile
[settings] arch=x86_64 build_type=Debug compiler=Visual Studio compiler.runtime=MDd compiler.version=16 os=Windows
[requires] opengl/system
[options] shared=False vulkan_static=False
[full_settings] arch=x86_64 build_type=Debug compiler=Visual Studio compiler.runtime=MDd compiler.version=16 os=Windows
[full_requires] opengl/system:5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9
[full_options] shared=False vulkan_static=False
[recipe_hash] 205c31edba0c4d470236d5216c7329ca
[env]
Steps to reproduce
conan install glfw/3.3.8@ --build=glfw -s build_type=Debug
Then take a look into the produced
build
andpackage
folders in conan cache.Logs
Click to expand log
``` warning LNK4099: PDB 'glfw3.pdb' was not found with 'glfw3.lib(init.obj)' or at 'D:\projects\build-conan-Visual Studio16\src\apps\Debug\glfw3.pdb'; linking object as if no debug info ```