Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install of PDB files does not work (with a possible fix?) #79

Closed
emmenlau opened this issue Jan 13, 2022 · 3 comments
Closed

Install of PDB files does not work (with a possible fix?) #79

emmenlau opened this issue Jan 13, 2022 · 3 comments

Comments

@emmenlau
Copy link

For me the installation of debugger pdb files in MSVC does not work. I do not know if this is caused by some build flags that I'm using or if this is a general issue(?)

I looked a bit at CMakeLists.txt and was under the impression that the library names in the PDB install command are incorrect. Here is a patch that I found makes the install work for me. If this works and is sensible, I would be more than happy if this could be included (no copyright attached):

 IF(MSVC AND INSTALL_MSVC_PDB)
-    INSTALL(FILES ${PROJECT_BINARY_DIR}/pcre2.pdb
-                  ${PROJECT_BINARY_DIR}/pcre2posix.pdb
+    INSTALL(FILES ${PROJECT_BINARY_DIR}/pcre2-8.pdb
+                  ${PROJECT_BINARY_DIR}/pcre2-16.pdb
+                  ${PROJECT_BINARY_DIR}/pcre2-32.pdb
+                  ${PROJECT_BINARY_DIR}/pcre2-posix.pdb
             DESTINATION bin
             CONFIGURATIONS RelWithDebInfo)
-    INSTALL(FILES ${PROJECT_BINARY_DIR}/pcre2d.pdb
-                  ${PROJECT_BINARY_DIR}/pcre2posixd.pdb
+    INSTALL(FILES ${PROJECT_BINARY_DIR}/pcre2-8d.pdb
+                  ${PROJECT_BINARY_DIR}/pcre2-16d.pdb
+                  ${PROJECT_BINARY_DIR}/pcre2-32d.pdb
+                  ${PROJECT_BINARY_DIR}/pcre2-posixd.pdb
             DESTINATION bin
             CONFIGURATIONS Debug)
 ENDIF(MSVC AND INSTALL_MSVC_PDB)
@emmenlau
Copy link
Author

I just wanted to add that its also possible to generate and store pdb files for static library builds. However requires that the COMPILE_PDB_NAME is set in cmake for the target. So something along those lines would need to be added in addition to the install command from above, too:

if (MSVC AND NOT BUILD_SHARED_LIBS)
    # Set the output name for debugger files, otherwise they are not generated:
    set_target_properties(${PROJECT_NAME}
        PROPERTIES
        COMPILE_PDB_NAME_DEBUG ${PROJECT_NAME}
        COMPILE_PDB_NAME_RELEASE ${PROJECT_NAME}
        COMPILE_PDB_NAME_MINSIZEREL ${PROJECT_NAME}
        COMPILE_PDB_NAME_RELWITHDEBINFO ${PROJECT_NAME})
endif()

Then the install command should work for the static and the shared case.

PS: I'm assuming here that the library target is called ${PROJECT_NAME}. Otherwise please replace this with the library target(s).

@PhilipHazel
Copy link
Collaborator

I am not a Windows user so have no way of testing this. However, it seems obvious from your first patch that the file names were incorrectly set up when PCRE2 was forked from PCRE1. Looks like nobody has tried to use this in the last seven years! I have applied your changes and committed the patch.

I haven't done anything about your second message because you said "something long these lines", as though it might be incomplete or untested. If you can provide a known working patch, I will apply it.

@emmenlau
Copy link
Author

Thanks a lot for applying the patch, it's really appreciated! I think its fine not to support the static case, for now, so I'll close this issue? We can open a new one if the request comes up.

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

No branches or pull requests

2 participants