diff --git a/CMakeLists.txt b/CMakeLists.txt index a913f49b1..05e21aac5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.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()