From c3312571826770e4f5dbbb3de7bc35d999762cb0 Mon Sep 17 00:00:00 2001 From: ZeldaZach Date: Sat, 18 Jan 2025 02:04:06 -0500 Subject: [PATCH] Generate PDBs for Windows Builds --- .github/workflows/desktop-build.yml | 6 ++++++ CMakeLists.txt | 11 +++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/desktop-build.yml b/.github/workflows/desktop-build.yml index 4d8ed29f0..01211770a 100644 --- a/.github/workflows/desktop-build.yml +++ b/.github/workflows/desktop-build.yml @@ -414,6 +414,12 @@ 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.pdb + path: "build/**/*.pdb" + - 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)