-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[LLVM][CMake][MSVC] Install PDBs alongside executables #120683
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
Conversation
2c3e4a9
to
ac540f9
Compare
Ping Should probably also be tagged with |
@llvm/pr-subscribers-platform-windows Author: Miguel A. Arroyo (mayanez) Changes
Full diff: https://github.com/llvm/llvm-project/pull/120683.diff 1 Files Affected:
diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake
index 54a54db338e695..48e2dfef148419 100644
--- a/llvm/cmake/modules/AddLLVM.cmake
+++ b/llvm/cmake/modules/AddLLVM.cmake
@@ -1489,6 +1489,11 @@ macro(llvm_add_tool project name)
${export_to_llvmexports}
RUNTIME DESTINATION ${${project}_TOOLS_INSTALL_DIR}
COMPONENT ${name})
+ if (MSVC)
+ install(FILES $<TARGET_PDB_FILE:${name}>
+ DESTINATION "${${project}_TOOLS_INSTALL_DIR}" COMPONENT ${name}
+ OPTIONAL)
+ endif()
if (NOT LLVM_ENABLE_IDE)
add_llvm_install_targets(install-${name}
@@ -1519,6 +1524,11 @@ macro(add_llvm_example name)
add_llvm_executable(${name} EXPORT_SYMBOLS ${ARGN})
if( LLVM_BUILD_EXAMPLES )
install(TARGETS ${name} RUNTIME DESTINATION "${LLVM_EXAMPLES_INSTALL_DIR}")
+ if (MSVC)
+ install(FILES $<TARGET_PDB_FILE:${name}>
+ DESTINATION "${LLVM_EXAMPLES_INSTALL_DIR}" COMPONENT ${name}
+ OPTIONAL)
+ endif()
endif()
get_subproject_title(subproject_title)
set_target_properties(${name} PROPERTIES FOLDER "${subproject_title}/Examples")
@@ -1553,6 +1563,11 @@ macro(add_llvm_utility name)
${export_to_llvmexports}
RUNTIME DESTINATION ${LLVM_UTILS_INSTALL_DIR}
COMPONENT ${name})
+ if (MSVC)
+ install(FILES $<TARGET_PDB_FILE:${name}>
+ DESTINATION "${LLVM_UTILS_INSTALL_DIR}" COMPONENT ${name}
+ OPTIONAL)
+ endif()
if (NOT LLVM_ENABLE_IDE)
add_llvm_install_targets(install-${name}
|
I think the reason why we weren’t doing it before is a concern of installation size. I agree having the PDBs would be useful. I’d rather prefer publishing them on a symbol server, and pull them on-demand instead. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that you should use LLVM_ENABLE_PDB
instead of MSVC
for the condition. However, I agree with @aganea that size is a concern. OTOH, this is primarily either used for staging and then subsequently building the installer (which could/would drop the PDB, so the distribution size shouldn't be impacted, in theory) or it is for the developer installing it to the system for some reason.
I think that @zmodem should verify that the installer would not package up the PDBs.
That's a good callout! I can make the change for that.
While orthogonal, wouldn't having them in the
Yes, if the installer doesn't pick it up that would be ideal. Otherwise, I can take a look at that next. |
I think with the current version of the patch, the PDBs would end up in the installer (I didn't have time to try it yet though). However if you gate it behind |
ac540f9
to
aa5aada
Compare
I've updated it to use |
* When building on Windows hosts, PDBs aren't installed to the `CMAKE_INSTALL_PREFIX`. * This PR addresses it solely for `llvm-*` executables. * Similar changes are required in `AddClang.cmake`, `AddLLD.cmake`, etc. I'd be happy to queue those PRs after this one.
* Follows up on #120683 enabling PDBs for `clang`.
…126675) * Follows up on llvm/llvm-project#120683 enabling PDBs for `clang`.
* Follows up on llvm#120683 enabling PDBs for `clang`.
* When building on Windows hosts, PDBs aren't installed to the `CMAKE_INSTALL_PREFIX`. * This PR addresses it solely for `llvm-*` executables. * Similar changes are required in `AddClang.cmake`, `AddLLD.cmake`, etc. I'd be happy to queue those PRs after this one.
* Follows up on llvm#120683 enabling PDBs for `clang`.
* When building on Windows hosts, PDBs aren't installed to the `CMAKE_INSTALL_PREFIX`. * This PR addresses it solely for `llvm-*` executables. * Similar changes are required in `AddClang.cmake`, `AddLLD.cmake`, etc. I'd be happy to queue those PRs after this one.
* Follows up on llvm#120683 enabling PDBs for `clang`.
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/98/builds/1156 Here is the relevant piece of the build log for the reference
|
* Follows up on #120683 installing PDBs for LLD.
…6680) * Follows up on llvm/llvm-project#120683 installing PDBs for LLD.
* Follows up on llvm#120683 installing PDBs for LLD.
When building on Windows hosts, PDBs aren't installed to the
CMAKE_INSTALL_PREFIX
.This PR addresses it solely for
llvm-*
executables.AddClang.cmake
,AddLLD.cmake
, etc. I'd be happy to queue those PRs after this one.