Imath icon indicating copy to clipboard operation
Imath copied to clipboard

No PDB files installed on Windows

Open SimonBoorer opened this issue 2 years ago • 3 comments

PDB files aren't installed when doing a Debug or RelWithDebInfo build on Windows.

This can be fixed by explicitly setting compiler generated PDB names:

  if(WIN32)
    set_target_properties(${libname} PROPERTIES
      COMPILE_PDB_NAME "${libname}"
    )
  endif()

and installing both compiler and linker generated PDB files:

  if(WIN32)
    if(BUILD_SHARED_LIBS)
      install(
          FILES $<TARGET_PDB_FILE:${libname}>
          DESTINATION ${CMAKE_INSTALL_BINDIR}
          OPTIONAL
      )
    else()
      install(
          FILES $<TARGET_FILE_DIR:${libname}>/${libname}.pdb
          DESTINATION ${CMAKE_INSTALL_LIBDIR}
          OPTIONAL
      )
    endif()
  endif()

for both Imath and PyImath libraries.

SimonBoorer avatar Feb 01 '23 18:02 SimonBoorer

Would you like to submit a PR for that? Or we can patch it; looks like a good addition.

meshula avatar Feb 03 '23 02:02 meshula

Hi @meshula, happy to submit a PR just waiting for corporate CLA approval.

SimonBoorer avatar Feb 03 '23 17:02 SimonBoorer

Should this perhaps be if(MSVC) specific (which also includes clang-cl) rather than if(WIN32) which will include MinGW (gcc and clang) as well and which do not generate PDB?

kmilos avatar Feb 13 '23 14:02 kmilos