Add support for installing PDBs with CMAKE_SHARED_LIBRARY_PREFIX_C - #958
Conversation
|
Thank you! I can see how and why this is failing. We last changed this configuration in PR #370, where the author commented on the existence of Basically, the CMake is file is "guessing" what the exact filename is going to be for the PDB file. By adding CMOKE_SHARED_LIBRARY_PREFIX_C, you've improved the guess, but there are many other CMake properties the user could have set, to customise the file basenames, prefixes, suffixes, and so on. Would you be able to fix it to request the actual pathname from CMake? Replace: - list(APPEND DLL_PDB_FILES $<TARGET_PDB_FILE_DIR:pcre2-8-shared>/pcre2-8.pdb)
- list(APPEND DLL_PDB_DEBUG_FILES $<TARGET_PDB_FILE_DIR:pcre2-8-shared>/pcre2-8d.pdb)
+ list(APPEND DLL_PDB_FILES "$<TARGET_PDB_FILE:pcre2-8-shared>")We only need to track one filename - and CMake shouldn't ever give us the wrong one! Delete all references to Then, we only need to install them when they exist (in Debug and RelWithDebInfo configurations): if(MSVC AND INSTALL_MSVC_PDB)
install(
FILES ${DLL_PDB_FILES}
DESTINATION ${CMAKE_INSTALL_BINDIR}
CONFIGURATIONS Debug RelWithDebInfo
)
endif() |
…rying to guess its name.
da66b46 to
ee8d355
Compare
|
I tested the proposed changes, they work as expected. |
|
Thank you! I will do some testing of my own, and merge. |
|
I have tested with the four different build types on Windows; using INSTALL_MSVC_PDB and with/without your CMAKE_SHARED_LIBRARY_PREFIX_C. Everything appears to work. |
Hello,
We are building pcre2 with a custom prefix for shared libraries on Windows.
We use
CMAKE_SHARED_LIBRARY_PREFIX_Cto set the prefix, resulting in both the dll and pdb being prefixed with the content of the variable.The pdb installation then fails, because the prefix is not taken into account in the
install()command.This PR intends to fix it.