Skip to content

Commit eb2eb71

Browse files
authored
Refactor PDB file handling in conanfile.py
Refactor PDB file copying logic and ensure all files are copied from the package directory.
1 parent acccbfc commit eb2eb71

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

conanfile.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,17 +149,20 @@ def package(self):
149149
]
150150
)
151151

152-
self.copy(pattern="*", src=package_dir)
152+
153153

154154
# Add the pdb files next to the libs for RelWithDebInfo linking
155155
if self.settings.os == "Windows":
156156
print("Copying PDBs...")
157157
pdb_dest = pathlib.Path(package_dir, "RelWithDebInfo", "pdb")
158158
pdb_dest.mkdir()
159-
pdb_files = pathlib.Path(self.build_folder).glob("*.pdb")
159+
pdb_files = pdb_files = [p for p in pathlib.Path(self.build_folder).rglob('*') if p.is_file() and p.suffix.lower() == '.pdb']
160+
print("PDB(s): ", pdb_files)
160161
for pfile in pdb_files:
161162
shutil.copy(pfile, pdb_dest)
162163

164+
self.copy(pattern="*", src=package_dir)
165+
163166
def package_info(self):
164167
self.cpp_info.relwithdebinfo.libdirs = ["RelWithDebInfo/lib"]
165168
self.cpp_info.relwithdebinfo.bindirs = ["RelWithDebInfo/Plugins", "RelWithDebInfo"]

0 commit comments

Comments
 (0)