From 1437c4a01a8f974653197f7f7994933a20ac52fb Mon Sep 17 00:00:00 2001 From: vvanelslande Date: Tue, 13 Aug 2019 21:10:22 -0500 Subject: [PATCH] Add MinGW CMake option to disable DWARF debugging information Also, I disabled it for the Linux MinGW build. --- .travis/linux-mingw/docker.sh | 8 +------- CMakeLists.txt | 2 ++ src/CMakeLists.txt | 4 +++- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.travis/linux-mingw/docker.sh b/.travis/linux-mingw/docker.sh index 051c06ad6..b3993dae9 100755 --- a/.travis/linux-mingw/docker.sh +++ b/.travis/linux-mingw/docker.sh @@ -5,7 +5,7 @@ cd /citra echo 'max_size = 3.0G' > "$HOME/.ccache/ccache.conf" mkdir build && cd build -cmake .. -G Ninja -DCMAKE_TOOLCHAIN_FILE="$(pwd)/../CMakeModules/MinGWCross.cmake" -DUSE_CCACHE=ON -DCMAKE_BUILD_TYPE=Release -DENABLE_QT_TRANSLATION=ON -DCITRA_ENABLE_COMPATIBILITY_REPORTING=${ENABLE_COMPATIBILITY_REPORTING:-"OFF"} -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON -DUSE_DISCORD_PRESENCE=ON -DENABLE_MF=ON -DENABLE_FFMPEG=ON -DCMAKE_NO_SYSTEM_FROM_IMPORTED=TRUE +cmake .. -G Ninja -DCMAKE_TOOLCHAIN_FILE="$(pwd)/../CMakeModules/MinGWCross.cmake" -DUSE_CCACHE=ON -DCMAKE_BUILD_TYPE=Release -DENABLE_QT_TRANSLATION=ON -DCITRA_ENABLE_COMPATIBILITY_REPORTING=${ENABLE_COMPATIBILITY_REPORTING:-"OFF"} -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON -DUSE_DISCORD_PRESENCE=ON -DENABLE_MF=ON -DENABLE_FFMPEG=ON -DCMAKE_NO_SYSTEM_FROM_IMPORTED=TRUE -DCOMPILE_WITH_DWARF=OFF ninja echo "Tests skipped" @@ -27,10 +27,4 @@ cp -rv "${QT_PLATFORM_DLL_PATH}/../mediaservice/" package/ cp -rv "${QT_PLATFORM_DLL_PATH}/../imageformats/" package/ rm -f package/mediaservice/*d.dll -for i in package/*.exe; do - # we need to process pdb here, however, cv2pdb - # does not work here, so we just simply strip all the debug symbols - x86_64-w64-mingw32-strip "${i}" -done - python3 .travis/linux-mingw/scan_dll.py package/*.exe package/imageformats/*.dll "package/" diff --git a/CMakeLists.txt b/CMakeLists.txt index 43bdfcbc9..ce6cf9ee8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,6 +27,8 @@ option(USE_DISCORD_PRESENCE "Enables Discord Rich Presence" OFF) CMAKE_DEPENDENT_OPTION(ENABLE_MF "Use Media Foundation decoder (preferred over FFmpeg)" ON "WIN32" OFF) +CMAKE_DEPENDENT_OPTION(COMPILE_WITH_DWARF "Add DWARF debugging information" ON "MINGW" OFF) + if(NOT EXISTS ${PROJECT_SOURCE_DIR}/.git/hooks/pre-commit) message(STATUS "Copying pre-commit hook") file(COPY hooks/pre-commit diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a6fb5c8f2..663a9493f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -71,7 +71,9 @@ else() if (MINGW) add_definitions(-DMINGW_HAS_SECURE_API) - add_compile_options("-gdwarf") + if (COMPILE_WITH_DWARF) + add_compile_options("-gdwarf") + endif() if (MINGW_STATIC_BUILD) add_definitions(-DQT_STATICPLUGIN)