Skip to content

Commit 7349fbd

Browse files
authored
Copy PDB files to Conan package on Windows
Added functionality to copy PDB files to the Conan package for Windows builds.
1 parent f2a803a commit 7349fbd

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

conanfile.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
import pathlib
77
import subprocess
88
from rules_support import PluginBranchInfo
9+
from conans import tools
10+
import shutil
911

1012
class PcaPluginConan(ConanFile):
1113
"""Class to package the PcaPluginPlugin using conan
@@ -151,6 +153,17 @@ def package(self):
151153
release_dir,
152154
]
153155
)
156+
157+
# Add the PDB files to the Conan package
158+
if self.settings.os == "Windows":
159+
print("Copying PDBs...")
160+
pdb_dest = pathlib.Path(package_dir, "RelWithDebInfo", "PDBs")
161+
pdb_dest.mkdir()
162+
pdb_files = pdb_files = [p for p in pathlib.Path(self.build_folder).rglob('*') if p.is_file() and p.suffix.lower() == '.pdb']
163+
print("PDB(s): ", pdb_files)
164+
for pfile in pdb_files:
165+
shutil.copy(pfile, pdb_dest)
166+
154167
self.copy(pattern="*", src=package_dir)
155168

156169
def package_info(self):
@@ -159,4 +172,4 @@ def package_info(self):
159172
self.cpp_info.relwithdebinfo.includedirs = ["RelWithDebInfo/include", "RelWithDebInfo"]
160173
self.cpp_info.release.libdirs = ["Release/lib"]
161174
self.cpp_info.release.bindirs = ["Release/Plugins", "Release"]
162-
self.cpp_info.release.includedirs = ["Release/include", "Release"]
175+
self.cpp_info.release.includedirs = ["Release/include", "Release"]

0 commit comments

Comments
 (0)