Skip to content

Commit b16e1e5

Browse files
Update PDB install logic for MSVC builds
Changed PDB file installation to apply only for MSVC and shared library builds, addressing compatibility and awaiting upstream CMake issue resolution. Fix partially #362
1 parent a5ef3d3 commit b16e1e5

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -370,15 +370,15 @@ else ()
370370
)
371371
endif (NOT WITH_PYTHON_WRAPPING AND NOT WITH_DOTNET_WRAPPING AND NOT WITH_JAVA_WRAPPING)
372372

373-
if (WIN32)
374-
#PDB for debug
373+
if (MSVC)
374+
#PDB only for debug and only for shared lib waiting for https://gitlab.kitware.com/cmake/cmake/-/issues/25244 fix
375375
INSTALL (
376-
FILES $<TARGET_PDB_FILE:${CPP_LIBRARY_NAME}>
376+
FILES $<$<BOOL:${BUILD_SHARED_LIBS}>:$<TARGET_PDB_FILE:${CPP_LIBRARY_NAME}>>
377377
CONFIGURATIONS Debug RelWithDebInfo
378378
DESTINATION ${CMAKE_INSTALL_BINDIR}
379379
OPTIONAL
380380
)
381-
endif (WIN32)
381+
endif (MSVC)
382382

383383
# PropertyTypeMapping.xml
384384
INSTALL (

0 commit comments

Comments
 (0)