1
0
mirror of synced 2024-11-28 01:20:51 +01:00

build: Reduce debug info produced (#1720)

This commit is contained in:
iTrooz 2024-05-27 16:33:15 +02:00 committed by GitHub
parent 0b0bf90e0b
commit 92b1234ddb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 17 additions and 2 deletions

View File

@ -384,6 +384,11 @@ jobs:
apt update apt update
bash dist/get_deps_debian.sh bash dist/get_deps_debian.sh
apt install software-properties-common -y
add-apt-repository ppa:ubuntu-toolchain-r/test -y
apt update
apt install -y gcc-13 g++-13
- name: ⬇️ Install .NET - name: ⬇️ Install .NET
uses: actions/setup-dotnet@v4 uses: actions/setup-dotnet@v4
with: with:
@ -397,7 +402,7 @@ jobs:
git config --global --add safe.directory '*' git config --global --add safe.directory '*'
mkdir -p build mkdir -p build
cd build cd build
CC=gcc-12 CXX=g++-12 cmake -G "Ninja" \ CC=gcc-13 CXX=g++-13 cmake -G "Ninja" \
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \ -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \
-DCMAKE_INSTALL_PREFIX="/usr" \ -DCMAKE_INSTALL_PREFIX="/usr" \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \ -DCMAKE_C_COMPILER_LAUNCHER=ccache \

View File

@ -600,6 +600,15 @@ macro(setupCompilerFlags target)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${IMHEX_COMMON_FLAGS} ${IMHEX_C_CXX_FLAGS}") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${IMHEX_COMMON_FLAGS} ${IMHEX_C_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${IMHEX_COMMON_FLAGS} ${IMHEX_C_CXX_FLAGS} ${IMHEX_CXX_FLAGS}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${IMHEX_COMMON_FLAGS} ${IMHEX_C_CXX_FLAGS} ${IMHEX_CXX_FLAGS}")
set(CMAKE_OBJC_FLAGS "${CMAKE_OBJC_FLAGS} ${IMHEX_COMMON_FLAGS}") set(CMAKE_OBJC_FLAGS "${CMAKE_OBJC_FLAGS} ${IMHEX_COMMON_FLAGS}")
# Only generate minimal debug information for stacktraces in RelWithDebInfo builds
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -g1")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -g1")
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
# Add flags for debug info in inline functions
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -gstatement-frontiers -ginline-points")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -gstatement-frontiers -ginline-points")
endif()
endmacro() endmacro()
# uninstall target # uninstall target

@ -1 +1 @@
Subproject commit 5d247e431935a1b67e5319526ff37a93847a6a8a Subproject commit f83b855b9778327cb0ac72996b73ae990966ec1c

View File

@ -30,6 +30,7 @@ add_executable(main ${APPLICATION_TYPE}
target_include_directories(main PUBLIC include) target_include_directories(main PUBLIC include)
setupCompilerFlags(main) setupCompilerFlags(main)
setupCompilerFlags(libimhex)
set(LIBROMFS_RESOURCE_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/romfs) set(LIBROMFS_RESOURCE_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/romfs)
set(LIBROMFS_PROJECT_NAME imhex) set(LIBROMFS_PROJECT_NAME imhex)