all repos — mgba @ e88aed2597ec1389c945d40eaff9302bfcc1eeb0

mGBA Game Boy Advance Emulator

Detect libedit
Jeffrey Pfau jeffrey@endrift.com
Tue, 12 Aug 2014 22:02:34 -0700
commit

e88aed2597ec1389c945d40eaff9302bfcc1eeb0

parent

4fe48ad820afd0150b138b6495cc31c269e4ada9

1 files changed, 11 insertions(+), 7 deletions(-)

jump to
M CMakeLists.txtCMakeLists.txt

@@ -70,13 +70,17 @@ endif()

set(DEBUGGER_SRC "${CMAKE_SOURCE_DIR}/src/debugger/debugger.c;${CMAKE_SOURCE_DIR}/src/debugger/memory-debugger.c") -if(USE_CLI_DEBUGGER AND NOT WIN32) - # Win32 doesn't have a usable command line, nor libedit, so this is useless on Windows - add_definitions(-DUSE_CLI_DEBUGGER) - list(APPEND DEBUGGER_SRC "${CMAKE_SOURCE_DIR}/src/debugger/cli-debugger.c") - list(APPEND DEBUGGER_SRC "${CMAKE_SOURCE_DIR}/src/debugger/parser.c") - pkg_search_module(EDIT libedit REQUIRED) - set(DEBUGGER_LIB ${EDIT_LIBRARIES}) +if(USE_CLI_DEBUGGER) + pkg_search_module(EDIT libedit) + if(EDIT_FOUND) + add_definitions(-DUSE_CLI_DEBUGGER) + list(APPEND DEBUGGER_SRC "${CMAKE_SOURCE_DIR}/src/debugger/cli-debugger.c") + list(APPEND DEBUGGER_SRC "${CMAKE_SOURCE_DIR}/src/debugger/parser.c") + set(DEBUGGER_LIB ${EDIT_LIBRARIES}) + else() + message(WARNING "Could not find libedit for CLI debugger support") + set(USE_CLI_DEBUGGER OFF) + endif() else() set(DEBUGGER_LIB "") endif()