CMAKE: search for supported debuggers

master
Martin Gerhardy 2019-06-27 18:23:21 +02:00
parent 2454beda65
commit ce9b6e9ab1
2 changed files with 11 additions and 2 deletions

View File

@ -60,8 +60,6 @@ option(VOXEDIT "Builds voxedit" ON)
option(MAPEDIT "Builds mapedit" ON)
option(NOISETOOL "Builds noisetool" ON)
option(VOXEDIT_ONLY "Builds voxedit only" OFF)
set(GDB_EXECUTABLE "gdb" CACHE STRING "The gnu debugger binary to use for the debug target")
set(LLDB_EXECUTABLE "lldb" CACHE STRING "The lldb binary to use for the debug target")
set(GIT_EXECUTABLE "git" CACHE STRING "The git binary to use for the update-libs target")
set(HG_EXECUTABLE "hg" CACHE STRING "The mercurial binary to use for the update-libs target")
option(USE_CCACHE "Use ccache" ON)

View File

@ -1,3 +1,14 @@
find_program(GDB_EXECUTABLE gdb)
find_program(LLDB_EXECUTABLE lldb)
if (GDB_EXECUTABLE)
set(DEBUGGER ${GDB_EXECUTABLE} CACHE STRING "Which debugger should be used")
elseif (LLDB_EXECUTABLE)
set(DEBUGGER ${LLDB_EXECUTABLE} CACHE STRING "Which debugger should be used")
else()
set(DEBUGGER "unknown" CACHE STRING "Which debugger should be used")
endif()
set_property(CACHE DEBUGGER PROPERTY STRINGS gdb lldb)
macro(engine_add_debuggger TARGET)
add_custom_target(${TARGET}-debug)
if (${DEBUGGER} STREQUAL "gdb")