Skip to content

[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

Merged
merged 1 commit into from
Feb 11, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions llvm/cmake/modules/AddLLVM.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1495,6 +1495,11 @@ macro(llvm_add_tool project name)
${export_to_llvmexports}
RUNTIME DESTINATION ${${project}_TOOLS_INSTALL_DIR}
COMPONENT ${name})
if (LLVM_ENABLE_PDB)
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}
Expand Down Expand Up @@ -1525,6 +1530,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 (LLVM_ENABLE_PDB)
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")
Expand Down Expand Up @@ -1559,6 +1569,11 @@ macro(add_llvm_utility name)
${export_to_llvmexports}
RUNTIME DESTINATION ${LLVM_UTILS_INSTALL_DIR}
COMPONENT ${name})
if (LLVM_ENABLE_PDB)
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}
Expand Down
Loading