Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ jobs:
if "${{ env.BUILD_TYPE }}"=="Release" (set CMAKE_UNITY_BUILD_OPT="-DCMAKE_UNITY_BUILD=ON")
cmake -D CMAKE_BUILD_TYPE="${{ env.BUILD_TYPE }}" ^
-D BUILD_SHARED_LIBS="${{ env.BUILD_SHARED_LIBS }}" ^
-D EXPORT_PDB="ON" ^
-D CMAKE_C_FLAGS="/WX" ^
-D CMAKE_CXX_FLAGS="/WX" ^
%CMAKE_CXX_STANDARD% ^
Expand Down
23 changes: 23 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,29 @@ set(docfiles COPYING NEWS.md AUTHORS.md)
install(FILES ${docfiles}
DESTINATION ${CMAKE_INSTALL_DOCDIR})

################################################################################
# Build debug symbols
################################################################################
option(EXPORT_PDB "Export PDB file" OFF)

if (WIN32 AND EXPORT_PDB)
target_compile_options(proj PRIVATE /Zi /Zf)
target_link_options(proj PRIVATE /DEBUG /OPT:REF /OPT:ICF)

if(BUILD_SHARED_LIBS)
set(pdbFile $<TARGET_PDB_FILE:proj>)
else()
set(pdbDirFullPath ${CMAKE_BINARY_DIR}/lib)
set_target_properties(proj
PROPERTIES
COMPILE_PDB_OUTPUT_DIRECTORY ${pdbDirFullPath}
COMPILE_PDB_NAME proj)
set(pdbFile ${pdbDirFullPath}/proj.pdb)
endif()

install(FILES ${pdbFile} DESTINATION lib)
endif()

################################################################################
# pkg-config support
################################################################################
Expand Down
Loading