Skip to content

[polyclipping] Also copy pdb files#50171

Draft
tobiasleibner wants to merge 1 commit intomicrosoft:masterfrom
tobiasleibner:polyclipping_copy_pdbs
Draft

[polyclipping] Also copy pdb files#50171
tobiasleibner wants to merge 1 commit intomicrosoft:masterfrom
tobiasleibner:polyclipping_copy_pdbs

Conversation

@tobiasleibner
Copy link
Contributor

@tobiasleibner tobiasleibner commented Feb 25, 2026

Same problem and same solution as in the Catch2 port: #49707

  • Changes comply with the maintainer guide.
  • SHA512s are updated for each updated download.
  • The "supports" clause reflects platforms that may be fixed by this new version, or no changes were necessary.
  • Any fixed CI baseline and CI feature baseline entries are removed from that file, or no entries needed to be changed.
  • All patch files in the port are applied and succeed.
  • The version database is fixed by rerunning ./vcpkg x-add-version --all and committing the result.
  • Exactly one version is added in each modified versions file.

# 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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

@tobiasleibner tobiasleibner Feb 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/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

  1. Check if the current toolchain requests program database debug information (Zi or ZI)
  2. 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 like VCPKG_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 the vcpkg_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).

@JavierMatosD JavierMatosD marked this pull request as draft February 25, 2026 19:08
@tobiasleibner tobiasleibner force-pushed the polyclipping_copy_pdbs branch 2 times, most recently from 79a6046 to de4e971 Compare February 26, 2026 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants