Qt: Fix build if USE_GDB_STUB is disabled
Jeffrey Pfau jeffrey@endrift.com
Fri, 12 Dec 2014 14:33:52 -0800
2 files changed,
8 insertions(+),
4 deletions(-)
M
src/platform/qt/CMakeLists.txt
→
src/platform/qt/CMakeLists.txt
@@ -3,6 +3,8 @@ enable_language(CXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++11") +set(PLATFORM_SRC) + if(BUILD_SDL) if(NOT SDL_FOUND AND NOT SDL2_FOUND) find_package(SDL 1.2 REQUIRED)@@ -10,8 +12,8 @@ endif()
if(SDL2_FOUND) link_directories(${SDL2_LIBDIR}) endif() - set(PLATFORM_LIBRARY "${PLATFORM_LIBRARY};${SDL_LIBRARY};${SDLMAIN_LIBRARY}") - set(PLATFORM_SRC ${PLATFORM_SRC} ${CMAKE_SOURCE_DIR}/src/platform/sdl/sdl-events.c ${CMAKE_SOURCE_DIR}/src/platform/sdl/sdl-audio.c) + list(APPEND PLATFORM_LIBRARY ${SDL_LIBRARY} ${SDLMAIN_LIBRARY}) + list(APPEND PLATFORM_SRC ${PLATFORM_SRC} ${CMAKE_SOURCE_DIR}/src/platform/sdl/sdl-events.c ${CMAKE_SOURCE_DIR}/src/platform/sdl/sdl-audio.c) include_directories(${SDL_INCLUDE_DIR} ${CMAKE_SOURCE_DIR}/src/platform/sdl) endif()@@ -68,7 +70,7 @@ return()
endif() if(USE_GDB_STUB) - set(SOURCE_FILES ${PLATFORM_SRC} ${SOURCE_FILES} GDBController.cpp GDBWindow.cpp) + list(APPEND PLATFORM_SRC GDBController.cpp GDBWindow.cpp) endif() set(MACOSX_BUNDLE_ICON_FILE mgba.icns) set(MACOSX_BUNDLE_BUNDLE_VERSION ${LIB_VERSION_STRING})@@ -80,7 +82,7 @@ qt5_add_resources(RESOURCES resources.qrc)
if(WIN32) list(APPEND RESOURCES ${CMAKE_SOURCE_DIR}/res/mgba.rc) endif() -add_executable(${BINARY_NAME}-qt WIN32 MACOSX_BUNDLE main.cpp ${CMAKE_SOURCE_DIR}/res/mgba.icns ${SOURCE_FILES} ${UI_FILES} ${RESOURCES}) +add_executable(${BINARY_NAME}-qt WIN32 MACOSX_BUNDLE main.cpp ${CMAKE_SOURCE_DIR}/res/mgba.icns ${SOURCE_FILES} ${PLATFORM_SRC} ${UI_FILES} ${RESOURCES}) set_target_properties(${BINARY_NAME}-qt PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_SOURCE_DIR}/res/info.plist.in) set(QT_LIBRARIES Qt5::Widgets Qt5::OpenGL)
M
src/platform/qt/GameController.cpp
→
src/platform/qt/GameController.cpp
@@ -100,6 +100,7 @@ delete m_renderer;
delete[] m_drawContext; } +#ifdef USE_GDB_STUB ARMDebugger* GameController::debugger() { return m_threadContext.debugger; }@@ -116,6 +117,7 @@ GBAAttachDebugger(m_threadContext.gba, m_threadContext.debugger);
} setPaused(wasPaused); } +#endif void GameController::loadGame(const QString& path, bool dirmode) { closeGame();