[lld] [LLD][CMake][MSVC] Install PDBs alongside executables (PR #126680)

Miguel A. Arroyo via llvm-commits llvm-commits at lists.llvm.org
Fri May 23 12:05:04 PDT 2025


https://github.com/mayanez updated https://github.com/llvm/llvm-project/pull/126680

>From 00fb4c839cba1a34c7a4285548d80fea1d819cee Mon Sep 17 00:00:00 2001
From: Miguel Arroyo <Miguel.Arroyo at rockstargames.com>
Date: Mon, 10 Feb 2025 22:02:29 -0800
Subject: [PATCH] [LLD][CMake][MSVC] Install PDBs alongside executables

---
 lld/cmake/modules/AddLLD.cmake | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lld/cmake/modules/AddLLD.cmake b/lld/cmake/modules/AddLLD.cmake
index 1de373ff860c4..37f73afa915f4 100644
--- a/lld/cmake/modules/AddLLD.cmake
+++ b/lld/cmake/modules/AddLLD.cmake
@@ -58,6 +58,10 @@ macro(add_lld_tool name)
         RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
         COMPONENT ${name})
 
+      if (LLVM_ENABLE_PDB)
+        install(FILES $<TARGET_PDB_FILE:${name}> DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT ${name} OPTIONAL)
+      endif()
+
       if(NOT CMAKE_CONFIGURATION_TYPES)
         add_llvm_install_targets(install-${name}
           DEPENDS ${name}



More information about the llvm-commits mailing list