mirror of https://github.com/PCSX2/pcsx2.git
CMake: Enable PDB generation in Release builds
This commit is contained in:
parent
241d7335e4
commit
bb56f274c8
|
@ -86,19 +86,17 @@ jobs:
|
||||||
id: cmake
|
id: cmake
|
||||||
shell: cmd
|
shell: cmd
|
||||||
run: |
|
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)
|
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%"
|
call "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\%vcvars%"
|
||||||
echo ::set-output name=buildtype::%type%
|
|
||||||
echo ::set-output name=vcvars::%vcvars%
|
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
|
- name: Build PCSX2
|
||||||
shell: cmd
|
shell: cmd
|
||||||
run: |
|
run: |
|
||||||
if "${{ inputs.configuration }}"=="CMake" (
|
if "${{ inputs.configuration }}"=="CMake" (
|
||||||
call "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\${{ steps.cmake.outputs.vcvars }}"
|
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/
|
cp build/pcsx2/pcsx2* bin/
|
||||||
) else (
|
) else (
|
||||||
msbuild "PCSX2_suite.sln" /m /v:m /p:Configuration="${{ inputs.configuration }}" /p:Platform="${{ inputs.platform }}"
|
msbuild "PCSX2_suite.sln" /m /v:m /p:Configuration="${{ inputs.configuration }}" /p:Platform="${{ inputs.platform }}"
|
||||||
|
@ -109,7 +107,7 @@ jobs:
|
||||||
shell: cmd
|
shell: cmd
|
||||||
run: |
|
run: |
|
||||||
call "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\${{ steps.cmake.outputs.vcvars }}"
|
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
|
- name: Upload artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
|
|
|
@ -197,17 +197,30 @@ else()
|
||||||
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-fno-operator-names>)
|
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-fno-operator-names>)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
set(CONFIG_REL_NO_DEB $<OR:$<CONFIG:Release>,$<CONFIG:MinSizeRel>>)
|
||||||
|
set(CONFIG_ANY_REL $<OR:$<CONFIG:Release>,$<CONFIG:MinSizeRel>,$<CONFIG:RelWithDebInfo>>)
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
add_compile_definitions(
|
add_compile_definitions(
|
||||||
$<$<CONFIG:Debug>:_ITERATOR_DEBUG_LEVEL=2>
|
$<$<CONFIG:Debug>:_ITERATOR_DEBUG_LEVEL=2>
|
||||||
$<$<CONFIG:Devel>:_ITERATOR_DEBUG_LEVEL=1>
|
$<$<CONFIG:Devel>:_ITERATOR_DEBUG_LEVEL=1>
|
||||||
$<$<CONFIG:RelWithDebInfo>:_ITERATOR_DEBUG_LEVEL=0>
|
$<${CONFIG_ANY_REL}:_ITERATOR_DEBUG_LEVEL=0>
|
||||||
$<$<CONFIG:MinSizeRel>:_ITERATOR_DEBUG_LEVEL=0>
|
|
||||||
$<$<CONFIG:Release>:_ITERATOR_DEBUG_LEVEL=0>
|
|
||||||
)
|
)
|
||||||
list(APPEND PCSX2_DEFS TIXML_USE_STL _SCL_SECURE_NO_WARNINGS _UNICODE UNICODE)
|
list(APPEND PCSX2_DEFS TIXML_USE_STL _SCL_SECURE_NO_WARNINGS _UNICODE UNICODE)
|
||||||
endif()
|
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)
|
if(USE_VTUNE)
|
||||||
list(APPEND PCSX2_DEFS ENABLE_VTUNE)
|
list(APPEND PCSX2_DEFS ENABLE_VTUNE)
|
||||||
endif()
|
endif()
|
||||||
|
|
Loading…
Reference in New Issue