From b7284542bcecafd2f677502a565d642527d542eb Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Fri, 24 Nov 2023 21:36:35 -0800 Subject: [PATCH] Debugger: Move CLIDebugerEditLine implementation into debugger/ --- CMakeLists.txt | 2 -- .../mgba/internal/debugger}/cli-el-backend.h | 0 src/debugger/CMakeLists.txt | 8 ++++++++ src/{feature/editline => debugger}/cli-el-backend.c | 2 +- src/platform/sdl/main.c | 2 +- 5 files changed, 10 insertions(+), 4 deletions(-) rename {src/feature/editline => include/mgba/internal/debugger}/cli-el-backend.h (100%) rename src/{feature/editline => debugger}/cli-el-backend.c (99%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 88d97aaa7..a1e730e04 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -539,14 +539,12 @@ if(USE_EDITLINE) set(DEBUGGER_LIB ${LIBEDIT_LIBRARIES}) endif() set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS},libedit2") - list(APPEND FEATURE_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src/feature/editline/cli-el-backend.c") else() set(DEBUGGER_LIB "") endif() if(USE_GDB_STUB) list(APPEND FEATURES GDB_STUB) - list(APPEND FEATURE_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/debugger/gdb-stub.c) endif() source_group("Debugger" FILES ${DEBUGGER_SRC}) diff --git a/src/feature/editline/cli-el-backend.h b/include/mgba/internal/debugger/cli-el-backend.h similarity index 100% rename from src/feature/editline/cli-el-backend.h rename to include/mgba/internal/debugger/cli-el-backend.h diff --git a/src/debugger/CMakeLists.txt b/src/debugger/CMakeLists.txt index 8bdc952de..ce2ade635 100644 --- a/src/debugger/CMakeLists.txt +++ b/src/debugger/CMakeLists.txt @@ -11,6 +11,14 @@ if(ENABLE_SCRIPTING) list(APPEND SOURCE_FILES cli-debugger-scripting.c) endif() +if(USE_EDITLINE) + list(APPEND SOURCE_FILES cli-el-backend.c) +endif() + +if(USE_GDB_STUB) + list(APPEND SOURCE_FILES gdb-stub.c) +endif() + set(TEST_FILES test/lexer.c test/parser.c) diff --git a/src/feature/editline/cli-el-backend.c b/src/debugger/cli-el-backend.c similarity index 99% rename from src/feature/editline/cli-el-backend.c rename to src/debugger/cli-el-backend.c index c76bb5d67..382a05c14 100644 --- a/src/feature/editline/cli-el-backend.c +++ b/src/debugger/cli-el-backend.c @@ -3,7 +3,7 @@ * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include "cli-el-backend.h" +#include #include #include diff --git a/src/platform/sdl/main.c b/src/platform/sdl/main.c index 2d9a74ae8..04a62f0d0 100644 --- a/src/platform/sdl/main.c +++ b/src/platform/sdl/main.c @@ -11,7 +11,7 @@ #include #endif #ifdef USE_EDITLINE -#include "feature/editline/cli-el-backend.h" +#include #endif #ifdef ENABLE_SCRIPTING #include