Save separate debug symbols on Linux

This commit is contained in:
Dan Paulat 2023-06-05 22:22:35 -05:00
parent a21377ce6c
commit c29f335d9a
4 changed files with 35 additions and 0 deletions

View file

@ -125,6 +125,24 @@ jobs:
-DCMAKE_BUILD_TYPE="${{ matrix.build_type }}" `
-DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/supercell-wx"
ninja supercell-wx wxtest
- name: Separate Debug Symbols (Linux)
if: matrix.os == 'ubuntu-22.04'
shell: bash
run: |
cd build/
cd bin/
objcopy --only-keep-debug supercell-wx supercell-wx.debug
objcopy --strip-debug --strip-unneeded supercell-wx
cd ..
cd lib/
objcopy --only-keep-debug libQMapLibreGL.so libQMapLibreGL.so.debug
objcopy --strip-debug --strip-unneeded libQMapLibreGL.so
- name: Install Supercell Wx
shell: pwsh
run: |
cd build
cmake --install . --component supercell-wx
- name: Collect Artifacts
@ -162,6 +180,15 @@ jobs:
name: supercell-wx-${{ matrix.artifact_suffix }}
path: ${{ github.workspace }}/supercell-wx-${{ matrix.artifact_suffix }}.tar.gz
- name: Upload Debug Artifacts (Linux)
if: matrix.os == 'ubuntu-22.04'
uses: actions/upload-artifact@v3
with:
name: supercell-wx-debug-${{ matrix.artifact_suffix }}
path: |
${{ github.workspace }}/build/bin/*.debug
${{ github.workspace }}/build/lib/*.debug
- name: Test Supercell Wx
working-directory: ${{ github.workspace }}/build
run: ctest -C ${{ matrix.build_type }} --exclude-regex mbgl-test-runner

View file

@ -17,6 +17,9 @@ if (MSVC)
target_link_options(qmaplibregl PRIVATE "$<$<CONFIG:Release>:/DEBUG>")
target_link_options(qmaplibregl PRIVATE "$<$<CONFIG:Release>:/OPT:REF>")
target_link_options(qmaplibregl PRIVATE "$<$<CONFIG:Release>:/OPT:ICF>")
else()
target_compile_options(mbgl-core PRIVATE "$<$<CONFIG:Release>:-g>")
target_compile_options(qmaplibregl PRIVATE "$<$<CONFIG:Release>:-g>")
endif()
set(MBGL_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/mapbox-gl-native/include

View file

@ -401,6 +401,9 @@ if (MSVC)
target_link_options(supercell-wx PRIVATE "$<$<CONFIG:Release>:/DEBUG>")
target_link_options(supercell-wx PRIVATE "$<$<CONFIG:Release>:/OPT:REF>")
target_link_options(supercell-wx PRIVATE "$<$<CONFIG:Release>:/OPT:ICF>")
else()
target_compile_options(scwx-qt PRIVATE "$<$<CONFIG:Release>:-g>")
target_compile_options(supercell-wx PRIVATE "$<$<CONFIG:Release>:-g>")
endif()
target_link_libraries(scwx-qt PUBLIC Qt${QT_VERSION_MAJOR}::Widgets

View file

@ -240,6 +240,8 @@ target_compile_options(wxdata PRIVATE
if (MSVC)
# Produce PDB file for debug
target_compile_options(wxdata PRIVATE "$<$<CONFIG:Release>:/Zi>")
else()
target_compile_options(wxdata PRIVATE "$<$<CONFIG:Release>:-g>")
endif()
target_link_libraries(wxdata PUBLIC aws-cpp-sdk-core