diff --git a/.github/workflows/windows_build_wx.yml b/.github/workflows/windows_build_wx.yml index 2360f3a9e7..9b765978f9 100644 --- a/.github/workflows/windows_build_wx.yml +++ b/.github/workflows/windows_build_wx.yml @@ -86,19 +86,17 @@ jobs: id: cmake shell: cmd run: | - if "${{ github.event.inputs.retainDebugArtifacts }}"=="true" (SET type=RelWithDebInfo) else (SET type=Release) if "${{ inputs.platform }}"=="Win32" (SET vcvars=vcvarsamd64_x86.bat) else (SET vcvars=vcvars64.bat) call "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\%vcvars%" - echo ::set-output name=buildtype::%type% echo ::set-output name=vcvars::%vcvars% - cmake . -B build -DCMAKE_BUILD_TYPE=%type% -DLTO_PCSX2_CORE=ON -G Ninja -DCMAKE_C_COMPILER_LAUNCHER=..\buildcache\bin\buildcache.exe -DCMAKE_CXX_COMPILER_LAUNCHER=..\buildcache\bin\buildcache.exe -DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON + cmake . -B build -DCMAKE_BUILD_TYPE=Release -DLTO_PCSX2_CORE=ON -G Ninja -DCMAKE_C_COMPILER_LAUNCHER=..\buildcache\bin\buildcache.exe -DCMAKE_CXX_COMPILER_LAUNCHER=..\buildcache\bin\buildcache.exe -DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON - name: Build PCSX2 shell: cmd run: | if "${{ inputs.configuration }}"=="CMake" ( call "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\${{ steps.cmake.outputs.vcvars }}" - cmake --build build --config ${{ steps.cmake.outputs.buildtype }} + cmake --build build --config Release cp build/pcsx2/pcsx2* bin/ ) else ( msbuild "PCSX2_suite.sln" /m /v:m /p:Configuration="${{ inputs.configuration }}" /p:Platform="${{ inputs.platform }}" @@ -109,7 +107,7 @@ jobs: shell: cmd run: | call "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\${{ steps.cmake.outputs.vcvars }}" - cmake --build build --config ${{ steps.cmake.outputs.buildtype }} --target unittests + cmake --build build --config Release --target unittests - name: Upload artifact uses: actions/upload-artifact@v3 diff --git a/cmake/BuildParameters.cmake b/cmake/BuildParameters.cmake index df05c46e30..87e68f8415 100644 --- a/cmake/BuildParameters.cmake +++ b/cmake/BuildParameters.cmake @@ -197,17 +197,30 @@ else() add_compile_options($<$:-fno-operator-names>) endif() +set(CONFIG_REL_NO_DEB $,$>) +set(CONFIG_ANY_REL $,$,$>) + if(WIN32) add_compile_definitions( $<$:_ITERATOR_DEBUG_LEVEL=2> $<$:_ITERATOR_DEBUG_LEVEL=1> - $<$:_ITERATOR_DEBUG_LEVEL=0> - $<$:_ITERATOR_DEBUG_LEVEL=0> - $<$:_ITERATOR_DEBUG_LEVEL=0> + $<${CONFIG_ANY_REL}:_ITERATOR_DEBUG_LEVEL=0> ) list(APPEND PCSX2_DEFS TIXML_USE_STL _SCL_SECURE_NO_WARNINGS _UNICODE UNICODE) endif() +if(MSVC) + # Enable PDB generation in release builds + add_compile_options( + $<${CONFIG_REL_NO_DEB}:/Zi> + ) + add_link_options( + $<${CONFIG_REL_NO_DEB}:/DEBUG> + $<${CONFIG_REL_NO_DEB}:/OPT:REF> + $<${CONFIG_REL_NO_DEB}:/OPT:ICF> + ) +endif() + if(USE_VTUNE) list(APPEND PCSX2_DEFS ENABLE_VTUNE) endif()