Allow building the GTK port without debugger support

This commit is contained in:
bgk 2008-06-16 20:18:49 +00:00
parent c64fd54be9
commit 2bd3eadac0
5 changed files with 44 additions and 8 deletions

View File

@ -16,6 +16,8 @@ PROJECT(VBA-M ASM C CXX)
# Both the SDL and the GTK+ frontends are built by default
# To disable building the SDL frontend add -DNO_SDL=1 on the commandline
# To disable building the GTK+ frontend add -DNO_GTK=1 on the commandline
# To disable building the debugger, add -DNO_DEBUGGER=1.
# The SDL frontend can't be built without debugger support
# To use ASM scalers, add -DUSE_ASM_SCALERS=1
# To use the ASM core, add -DUSE_ASM_CORE=1
# Set the version number with -DVERSION=X.X.X-uber
@ -72,10 +74,23 @@ IF( NOT SYSCONFDIR )
ENDIF( NOT SYSCONFDIR )
# C defines
ADD_DEFINITIONS (-DHAVE_NETINET_IN_H -DHAVE_ARPA_INET_H -DHAVE_ZLIB_H -DFINAL_VERSION -DBKPT_SUPPORT -DSDL -DUSE_OPENGL -DSYSCONFDIR='"${SYSCONFDIR}"')
ADD_DEFINITIONS (-DHAVE_NETINET_IN_H -DHAVE_ARPA_INET_H -DHAVE_ZLIB_H -DFINAL_VERSION -DSDL -DUSE_OPENGL -DSYSCONFDIR='"${SYSCONFDIR}"')
ADD_DEFINITIONS (-DVERSION='"${VERSION}"' -DPKGDATADIR='"${PKGDATADIR}"' -DPACKAGE='')
# The debugger is enabled by default
# The SDL port can't be built without debugging support
IF( NO_DEBUGGER )
IF( CAN_BUILD_VBAM )
MESSAGE(STATUS "The SDL port can't be built without debugging support")
SET( CAN_BUILD_VBAM 0 )
ENDIF( CAN_BUILD_VBAM )
ADD_DEFINITIONS (-DNO_DEBUGGER)
ELSE( NO_DEBUGGER )
ADD_DEFINITIONS (-DBKPT_SUPPORT)
ENDIF( NO_DEBUGGER )
# The ASM core is disabled by default because we don't know on which platform we are
IF( NOT USE_ASM_CORE )
ADD_DEFINITIONS (-DC_CORE)
@ -94,13 +109,11 @@ SET( CMAKE_CXX_FLAGS "-O3 -Wall")
SET(SRC_MAIN
src/2xSaI.cpp
src/admame.cpp
src/armdis.cpp
src/bilinear.cpp
src/bios.cpp
src/Cheats.cpp
src/CheatSearch.cpp
src/EEprom.cpp
src/elf.cpp
src/Flash.cpp
src/Globals.cpp
src/interframe.cpp
@ -112,15 +125,11 @@ SET(SRC_MAIN
src/Mode4.cpp
src/Mode5.cpp
src/pixel.cpp
src/remote.cpp
src/RTC.cpp
src/scanline.cpp
src/Sound.cpp
src/Sram.cpp
src/Util.cpp
src/expr.cpp
src/exprNode.cpp
src/expr-lex.cpp
src/memgzio.c
)
@ -193,6 +202,17 @@ SET(SRC_GTK
src/gtk/sndPortAudio.cpp
)
IF( NOT NO_DEBUGGER )
SET(SRC_DEBUGGER
src/armdis.cpp
src/elf.cpp
src/expr.cpp
src/exprNode.cpp
src/expr-lex.cpp
src/remote.cpp
)
ENDIF( NOT NO_DEBUGGER )
IF(CMAKE_ASM_COMPILER_LOADED AND USE_ASM_SCALERS)
SET(SRC_HQ ${SRC_HQ_ASM})
ELSE(CMAKE_ASM_COMPILER_LOADED AND USE_ASM_SCALERS)
@ -214,6 +234,7 @@ ADD_LIBRARY (
${SRC_AGB}
${SRC_DMG}
${SRC_FEX_MINI}
${SRC_DEBUGGER}
)
IF( CAN_BUILD_VBAM )

View File

@ -1272,7 +1272,9 @@ void CPUCleanUp()
ioMem = NULL;
}
#ifndef NO_DEBUGGER
elfCleanUp();
#endif //NO_DEBUGGER
systemSaveUpdateCounter = SYSTEM_SAVE_NOT_UPDATED;
@ -1303,6 +1305,7 @@ int CPULoadRom(const char *szFile)
u8 *whereToLoad = cpuIsMultiBoot ? workRAM : rom;
#ifndef NO_DEBUGGER
if(CPUIsELF(szFile)) {
FILE *f = fopen(szFile, "rb");
if(!f) {
@ -1323,7 +1326,9 @@ int CPULoadRom(const char *szFile)
elfCleanUp();
return 0;
}
} else if(!utilLoad(szFile,
} else
#endif //NO_DEBUGGER
if(!utilLoad(szFile,
utilIsGBAImage,
whereToLoad,
romSize)) {

View File

@ -817,6 +817,7 @@ Window::Window(GtkWindow * _pstWindow, const Glib::RefPtr<Xml> & _poXml) :
// GDB menu
//
#ifndef NO_DEBUGGER
poMI = dynamic_cast<Gtk::MenuItem *>(_poXml->get_widget("GdbWait"));
poMI->signal_activate().connect(sigc::mem_fun(*this, &Window::vOnGDBWait));
@ -828,6 +829,11 @@ Window::Window(GtkWindow * _pstWindow, const Glib::RefPtr<Xml> & _poXml) :
poMI = dynamic_cast<Gtk::MenuItem *>(_poXml->get_widget("GdbDisconnect"));
poMI->signal_activate().connect(sigc::mem_fun(*this, &Window::vOnGDBDisconnect));
#else
// Hide the whole Tools menu as it only contains the debugger stuff as of now
poMI = dynamic_cast<Gtk::MenuItem *>(_poXml->get_widget("ToolsMenu"));
poMI->hide();
#endif //NO_DEBUGGER
// Help menu
//

View File

@ -183,10 +183,12 @@ protected:
virtual void vOnJoypadConfigure(int _iJoypad);
virtual void vOnJoypadToggled(Gtk::CheckMenuItem * _poCMI, int _iJoypad);
virtual void vOnAutofireToggled(Gtk::CheckMenuItem * _poCMI, u32 _uiKeyFlag);
#ifndef NO_DEBUGGER
virtual void vOnGDBWait();
virtual void vOnGDBLoadAndWait();
virtual void vOnGDBBreak();
virtual void vOnGDBDisconnect();
#endif //NO_DEBUGGER
virtual void vOnHelpAbout();
virtual bool bOnEmuIdle();

View File

@ -1004,6 +1004,7 @@ void Window::vOnAutofireToggled(Gtk::CheckMenuItem * _poCMI, u32 _uiKeyFlag)
m_poInputConfig->vSetKey(sKey, _poCMI->get_active());
}
#ifndef NO_DEBUGGER
void Window::vOnGDBWait()
{
Glib::RefPtr<Xml> poXml;
@ -1155,6 +1156,7 @@ void Window::vOnGDBDisconnect()
remoteCleanUp();
debugger = false;
}
#endif //NO_DEBUGGER
void Window::vOnHelpAbout()
{