File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 7575 if "${{ env.BUILD_TYPE }}"=="Release" (set CMAKE_UNITY_BUILD_OPT="-DCMAKE_UNITY_BUILD=ON")
7676 cmake -D CMAKE_BUILD_TYPE="${{ env.BUILD_TYPE }}" ^
7777 -D BUILD_SHARED_LIBS="${{ env.BUILD_SHARED_LIBS }}" ^
78+ -D EXPORT_PDB="ON" ^
7879 -D CMAKE_C_FLAGS="/WX" ^
7980 -D CMAKE_CXX_FLAGS="/WX" ^
8081 %CMAKE_CXX_STANDARD% ^
Original file line number Diff line number Diff line change @@ -432,6 +432,29 @@ set(docfiles COPYING NEWS.md AUTHORS.md)
432432install (FILES ${docfiles}
433433 DESTINATION ${CMAKE_INSTALL_DOCDIR} )
434434
435+ ################################################################################
436+ # Build debug symbols
437+ ################################################################################
438+ option (EXPORT_PDB "Export PDB file" OFF )
439+
440+ if (WIN32 AND EXPORT_PDB)
441+ target_compile_options (proj PRIVATE /Zi /Zf )
442+ target_link_options (proj PRIVATE /DEBUG /OPT:REF /OPT:ICF )
443+
444+ if (BUILD_SHARED_LIBS )
445+ set (pdbFile $<TARGET_PDB_FILE :proj >)
446+ else ()
447+ set (pdbDirFullPath ${CMAKE_BINARY_DIR } /lib)
448+ set_target_properties (proj
449+ PROPERTIES
450+ COMPILE_PDB_OUTPUT_DIRECTORY ${pdbDirFullPath}
451+ COMPILE_PDB_NAME proj)
452+ set (pdbFile ${pdbDirFullPath} /proj.pdb)
453+ endif ()
454+
455+ install (FILES ${pdbFile} DESTINATION lib)
456+ endif ()
457+
435458################################################################################
436459# pkg-config support
437460################################################################################
You can’t perform that action at this time.
0 commit comments