From 47ffe952bcfc31a78c16be8620109955fdc17f2f Mon Sep 17 00:00:00 2001 From: Oxore Date: Mon, 12 Jun 2023 23:57:00 +0300 Subject: Optimize debug run --- CMakeLists.txt | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 5f89536..487b6fd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,6 +45,14 @@ target_include_directories(musashi_m68k PRIVATE # TODO make SDL2 optional for headless mode find_package(SDL2 REQUIRED) +set(common_debug_flags + # XXX Sanitizers make everything really slow + #-fsanitize=address + -O1 + # Uncomment to enable profiling + #-pg + ) + add_executable(emulator ${emulator_sources}) target_compile_options(emulator PRIVATE $<$:-fms-extensions> @@ -65,11 +73,12 @@ target_compile_options(emulator PRIVATE -Wlogical-op -pedantic -g3 - -O2 - -fsanitize=address,undefined + $<$:${common_debug_flags}> ) -target_link_options(emulator PRIVATE -fsanitize=address,undefined) +target_link_options(emulator PRIVATE + $<$:${common_debug_flags}> + ) target_link_libraries(emulator musashi_m68k) # TODO make SDL2 optional for headless mode target_include_directories(emulator PRIVATE ${SDL2_INCLUDE_DIRS}) @@ -83,6 +92,7 @@ target_compile_definitions(emulator PRIVATE HAS_GRAPHICS=1 ) + ## Target for GDB Remote Debugging protocol implementation testing #add_executable(gdbremote # gdbremote.cpp -- cgit v1.2.3