Skip to content

Commit 3e0ac0e

Browse files
authored
Add PDB file copying for Windows builds (#207)
* Add PDB file copying for Windows builds Copy PDB files to the RelWithDebInfo/lib directory on Windows. * Add debug information flag for RelWithDebInfo mode * Add import for tools in conanfile.py * Set ManiVault installation directory from environment Add installation directory for ManiVault * Update conanfile.py * Refactor PDB file handling in conanfile.py Remove installation directory from environment variable and update PDB destination path. * Fix pdb file copying for RelWithDebInfo builds Ensure pdb files are copied correctly for Windows builds. * Update conanfile.py * Fix pdb destination path for Windows builds * Update Windows OS check in conanfile.py * Log PDB file copying on Windows Add print statement for PDB file copying process * Refactor PDB file handling in conanfile.py Refactor PDB file copying logic and ensure all files are copied from the package directory. * Add import for shutil module
1 parent ec35367 commit 3e0ac0e

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
2525
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MDd")
2626
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /MD")
2727
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MD")
28+
set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO} /DEBUG")
2829
endif()
2930

3031
# -----------------------------------------------------------------------------

conanfile.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
from conans import ConanFile
22
from conan.tools.cmake import CMakeDeps, CMake, CMakeToolchain
33
from conans.tools import save, load
4+
from conans import tools
45
import os
56
import pathlib
7+
import shutil
68
import subprocess
79
from rules_support import PluginBranchInfo
810

@@ -98,6 +100,7 @@ def generate(self):
98100
# Use the ManiVault .cmake file to find ManiVault with find_package
99101
mv_core_root = self.deps_cpp_info["hdps-core"].rootpath
100102
manivault_dir = pathlib.Path(mv_core_root, "cmake", "mv").as_posix()
103+
101104
print("ManiVault_DIR: ", manivault_dir)
102105
tc.variables["ManiVault_DIR"] = manivault_dir
103106

@@ -146,6 +149,19 @@ def package(self):
146149
release_dir,
147150
]
148151
)
152+
153+
154+
155+
# Add the pdb files next to the libs for RelWithDebInfo linking
156+
if self.settings.os == "Windows":
157+
print("Copying PDBs...")
158+
pdb_dest = pathlib.Path(package_dir, "RelWithDebInfo", "pdb")
159+
pdb_dest.mkdir()
160+
pdb_files = pdb_files = [p for p in pathlib.Path(self.build_folder).rglob('*') if p.is_file() and p.suffix.lower() == '.pdb']
161+
print("PDB(s): ", pdb_files)
162+
for pfile in pdb_files:
163+
shutil.copy(pfile, pdb_dest)
164+
149165
self.copy(pattern="*", src=package_dir)
150166

151167
def package_info(self):

0 commit comments

Comments
 (0)