summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt16
1 files changed, 13 insertions, 3 deletions
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
$<$<COMPILE_LANGUAGE:CXX>:-fms-extensions>
@@ -65,11 +73,12 @@ target_compile_options(emulator PRIVATE
-Wlogical-op
-pedantic
-g3
- -O2
- -fsanitize=address,undefined
+ $<$<CONFIG:DEBUG>:${common_debug_flags}>
)
-target_link_options(emulator PRIVATE -fsanitize=address,undefined)
+target_link_options(emulator PRIVATE
+ $<$<CONFIG:DEBUG>:${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