[polyclipping] Also copy pdb files#50171
[polyclipping] Also copy pdb files#50171tobiasleibner wants to merge 1 commit intomicrosoft:masterfrom
Conversation
ports/polyclipping/portfile.cmake
Outdated
| # Copy pdb files to lib folders | ||
| if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) | ||
| # polyclipping builds static libraries even when shared libraries are requested. | ||
| # We thus cannot use vcpkg_copy_pdbs which only works for dlls but have to search for the pdbs manually. |
There was a problem hiding this comment.
I believe the correct fix is to use /Z7 instead. Build systems almost always pick names that will conflict with the universe for PDBs of static libs which is a big part of why we use /Z7.
There was a problem hiding this comment.
/Z7 sounds like it is the proper fix but I am not sure how to apply it. If I understand correctly, we would like to
- Check if the current toolchain requests program database debug information (
ZiorZI) - If it does, replace that with
Z7.
I am happy to do that but I will need some guidance because I am not sure how to do either of these steps.
For 1.: Do I have to parse something likeVCPKG_CXX_FLAGS? But that does not seem to be set in the portfile.
For 2.: Can I provide that via-DCMAKE_CXX_FLAGS="/Z7"to thevcpkg_cmake_configure? But that might lose other flags and also cause warnings like "warning: overriding /Zi with /Z7".
My approach to copy the pdb files (https://github.com/microsoft/vcpkg/pull/49707/changes#diff-135c4b2289b6d5e5479d45db57022f97072fe8a4495899524af68b6251674981R46) is not pretty but seems to work and does not do anything if there are no pdb files. Also, the filename is polyclipping.pdb for me, but that might be due to my project settings. To make sure the pdb file has a proper name we can maybe set COMPILE_PDB_NAME on the polyclipping target? (Might need a patch to the CMakeLists.txt).
79a6046 to
de4e971
Compare
de4e971 to
6f3b66e
Compare
Same problem and same solution as in the Catch2 port: #49707
./vcpkg x-add-version --alland committing the result.