From 2c7f51cd436e9b0ce88271e84ce5a77c19f2c23b Mon Sep 17 00:00:00 2001 From: Brues <5278969+brues-code@users.noreply.github.com> Date: Sat, 22 Aug 2026 16:06:26 -0500 Subject: [PATCH] ci: ship PDB debug symbols with release --- .github/workflows/msvc_cmake.yml | 3 ++- nampower/CMakeLists.txt | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/msvc_cmake.yml b/.github/workflows/msvc_cmake.yml index 033c9aa..129bb12 100644 --- a/.github/workflows/msvc_cmake.yml +++ b/.github/workflows/msvc_cmake.yml @@ -117,7 +117,7 @@ jobs: - name: Build run: | cmake --build ${{ github.workspace }}/build --config ${{ env.BUILD_TYPE }} - cmake --install ${{ github.workspace }}/build + cmake --install ${{ github.workspace }}/build --config ${{ env.BUILD_TYPE }} - name: Publish artifact uses: actions/upload-artifact@v4 @@ -153,4 +153,5 @@ jobs: files: | nampower-${{ github.ref_name }}.zip nampower-${{ github.ref_name }}/nampower.dll + nampower-${{ github.ref_name }}/nampower.pdb fail_on_unmatched_files: true diff --git a/nampower/CMakeLists.txt b/nampower/CMakeLists.txt index e45f4f2..8b06f8f 100644 --- a/nampower/CMakeLists.txt +++ b/nampower/CMakeLists.txt @@ -69,4 +69,13 @@ target_link_libraries(${DLL_NAME} shlwapi.lib asmjit.lib udis86.lib) # Generate MAP file for debugging crashes target_link_options(${DLL_NAME} PRIVATE /MAP) +# Emit full debug symbols (PDB) even in Release so shipped crashes can be +# symbolicated. /Zi produces the debug info; /DEBUG writes the PDB and stamps its +# GUID into the DLL. /DEBUG defaults to /OPT:NOREF,NOICF, so re-enable +# /OPT:REF,ICF to keep the same dead-code elimination and COMDAT folding as a +# plain Release build (i.e. the symbols are added without bloating the binary). +target_compile_options(${DLL_NAME} PRIVATE /Zi) +target_link_options(${DLL_NAME} PRIVATE /DEBUG /OPT:REF /OPT:ICF) + install(TARGETS ${DLL_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}") +install(FILES $ DESTINATION "${CMAKE_INSTALL_PREFIX}")