Skip to content

Commit

Permalink
Add option to build minimized debug symbols
Browse files Browse the repository at this point in the history
Related to 621f4c5
  • Loading branch information
ltoenning authored and oktal3700 committed Nov 14, 2023
1 parent 2f3dc5a commit b9aa3ca
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ cmake_dependent_option(SWIFT_BUILD_XSWIFTBUS "Build xswiftbus" ON "NOT SWIFT_WIN
option(SWIFT_BUILD_FLIGHTGEAR_PLUGIN "Build Flightgear plugin" ON)
option(SWIFT_BUILD_EMULATED_PLUGIN "Build Emulated plugin" ON)
cmake_dependent_option(SWIFT_BUILD_MSFS_PLUGIN "Build MSFS plugin" ON WIN32 OFF)
option(SWIFT_MINIFY_DEBUG_SYMBOLS "Minify debug symbols" OFF)

option(SWIFT_BUILD_BLACKCORE "Build Blackcore" ON)
option(SWIFT_BUILD_BLACKSOUND "Build Blacksound" ON)
Expand All @@ -56,6 +57,15 @@ option(SWIFT_VATSIM_SUPPORT "Build with VATSIM support" ON)
set(VATSIM_KEY_JSON "" CACHE STRING "Path to JSON containing VATSIM key")
load_vatsim_key()

if(SWIFT_MINIFY_DEBUG_SYMBOLS)
if(${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC)
add_compile_options(/OPT:REF /OPT:ICF)
elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL GNU)
add_compile_options(-g1 -gz)
elseif(${CMAKE_CXX_COMPILER_ID} MATCHES ".*Clang")
add_compile_options(-gline-tables-only)
endif()
endif()

if(MSVC)
# This also installs some dlls which we do not need
Expand Down
1 change: 1 addition & 0 deletions scripts/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def build(self, jobs, cmake_args, dev_build):
'..',
'-G {}'.format(self._get_generator()),
'-DCMAKE_BUILD_TYPE=RelWithDebInfo',
'-DSWIFT_MINIFY_DEBUG_SYMBOLS=ON',
'-DCMAKE_INSTALL_PREFIX=../dist',
'-DSWIFT_USE_CRASHPAD={}'.format(use_crashpad)] + cmake_args
subprocess.check_call(cmake_call, env=dict(os.environ))
Expand Down

0 comments on commit b9aa3ca

Please sign in to comment.