From 55b490ade0ab46f7bddf0e0ad7a74807fe93de9b Mon Sep 17 00:00:00 2001 From: Zach H Date: Sat, 18 Jan 2025 02:54:01 -0500 Subject: [PATCH] Generate PDBs for Windows Builds (#5494) --- .github/workflows/desktop-build.yml | 9 +++++++++ CMakeLists.txt | 11 +++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/.github/workflows/desktop-build.yml b/.github/workflows/desktop-build.yml index 4d8ed29f0..6b09a3c3d 100644 --- a/.github/workflows/desktop-build.yml +++ b/.github/workflows/desktop-build.yml @@ -414,6 +414,15 @@ jobs: path: ${{steps.build.outputs.path}} if-no-files-found: error + - name: Upload pdb database + uses: actions/upload-artifact@v4 + with: + name: Windows${{matrix.target}}-debug-pdbs + path: | + build/cockatrice/Release/*.pdb + build/servatrice/Release/*.pdb + if-no-files-found: error + - name: Upload to release if: matrix.package != 'skip' && needs.configure.outputs.tag != null shell: bash diff --git a/CMakeLists.txt b/CMakeLists.txt index 0e458146b..0026a39f5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -140,12 +140,15 @@ endif() # Define proper compilation flags if(MSVC) - # Visual Studio: Disable Warning C4251, C++20 compatibility, Multi-threaded Builds, Warn Detection, Unwind Semantics - set(CMAKE_CXX_FLAGS "/wd4251 /Zc:__cplusplus /std:c++20 /permissive- /W4 /MP /EHsc") + # Disable Warning C4251, C++20 compatibility, Multi-threaded Builds, Warn Detection, Unwind Semantics, Debug Symbols + set(CMAKE_CXX_FLAGS "/wd4251 /Zc:__cplusplus /std:c++20 /permissive- /W4 /MP /EHsc /Zi") # Visual Studio: Maximum Optimization, Multi-threaded DLL set(CMAKE_CXX_FLAGS_RELEASE "/Ox /MD") - # Visual Studio: No Optimization, Multi-threaded Debug DLL, Debug Symbols - set(CMAKE_CXX_FLAGS_DEBUG "/Od /MDd /Zi") + # Visual Studio: No Optimization, Multi-threaded Debug DLL + set(CMAKE_CXX_FLAGS_DEBUG "/Od /MDd") + + # Generate PDB, even when in release (So developers can better analyze crash logs) + set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /DEBUG /OPT:REF /OPT:ICF") add_compile_definitions(_SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING) elseif(CMAKE_COMPILER_IS_GNUCXX)