diff --git a/CMakeLists.txt b/CMakeLists.txt index 1a77b35b..058d4e4d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,7 +41,7 @@ FIND_PACKAGE ( ZLIB REQUIRED ) FIND_PACKAGE ( PNG REQUIRED ) FIND_PACKAGE ( OpenGL REQUIRED ) FIND_PACKAGE ( SDL REQUIRED ) -FIND_PACKAGE ( SFML REQUIRED ) +FIND_PACKAGE ( SFML ) # Disable looking for GTK if not going to build the GTK frontend # so that pkg-config is not required @@ -50,6 +50,7 @@ IF(NOT NO_GTK) # These dependencies require pkg-config to be found PKG_CHECK_MODULES ( GTKMM gtkmm-2.4 ) + PKG_CHECK_MODULES ( GDKMM gdkmm-2.4 ) PKG_CHECK_MODULES ( GLIBMM glibmm-2.4 ) PKG_CHECK_MODULES ( GIOMM giomm-2.4 ) PKG_CHECK_MODULES ( GTKGLMM gtkglextmm-x11-1.2 ) @@ -91,6 +92,12 @@ ADD_DEFINITIONS (-DHAVE_NETINET_IN_H -DHAVE_ARPA_INET_H -DHAVE_ZLIB_H -DFINAL_VE ADD_DEFINITIONS (-DVERSION='"${VERSION}"' -DPKGDATADIR='"${PKGDATADIR}"' -DPACKAGE='') +# Linking is disabled if SFML has not been found +IF( NOT SFML_FOUND ) + ADD_DEFINITIONS (-DNO_LINK) + MESSAGE(STATUS "SFML was not found, link support is disabled") +ENDIF( NOT SFML_FOUND ) + # The debugger is enabled by default # The SDL port can't be built without debugging support IF( NO_DEBUGGER ) @@ -284,6 +291,7 @@ IF( CAN_BUILD_GVBAM ) ${GLIBMM_INCLUDE_DIRS} ${GIOMM_INCLUDE_DIRS} ${GTKMM_INCLUDE_DIRS} + ${GDKMM_INCLUDE_DIRS} ${GTKGLMM_INCLUDE_DIRS} ) diff --git a/src/gba/GBALink.cpp b/src/gba/GBALink.cpp index 600398e4..1b0b6ea6 100644 --- a/src/gba/GBALink.cpp +++ b/src/gba/GBALink.cpp @@ -1,5 +1,12 @@ // This file was written by denopqrihg +// Joybus +bool gba_joybus_enabled = false; + +// If disabled, gba core won't call any (non-joybus) link functions +bool gba_link_enabled = false; + +#ifndef NO_LINK #ifdef _WIN32 #include "../win32/stdafx.h" #include "../win32/VBA.h" @@ -18,14 +25,9 @@ int linktime = 0; -// Joybus -bool gba_joybus_enabled = false; GBASockClient* dol = NULL; sf::IPAddress joybusHostAddr = sf::IPAddress::LocalHost; -// If disabled, gba core won't call any (non-joybus) link functions -bool gba_link_enabled = false; - #ifdef _MSC_VER // Hodgepodge u8 tspeed = 3; @@ -1219,3 +1221,7 @@ void LinkSSend(u16 value){ } #endif // _MSC_VER + +#else // NO_LINK +void JoyBusUpdate(int ticks) {} +#endif // NO_LINK diff --git a/src/gba/GBALink.h b/src/gba/GBALink.h index 4a81cfe0..759d3374 100644 --- a/src/gba/GBALink.h +++ b/src/gba/GBALink.h @@ -1,6 +1,8 @@ #pragma once +#ifndef NO_LINK #include +#endif #define LINK_PARENTLOST 0x80 #define UNSUPPORTED -1 @@ -116,7 +118,9 @@ typedef struct { #endif extern bool gba_joybus_enabled; +#ifndef NO_LINK extern sf::IPAddress joybusHostAddr; +#endif extern void JoyBusConnect(); extern void JoyBusShutdown(); extern void JoyBusUpdate(int ticks); diff --git a/src/gba/GBASockClient.cpp b/src/gba/GBASockClient.cpp index 833c44d3..05843f56 100644 --- a/src/gba/GBASockClient.cpp +++ b/src/gba/GBASockClient.cpp @@ -1,3 +1,5 @@ +#ifndef NO_LINK + #include "GBASockClient.h" // Currently only for Joybus communications @@ -36,3 +38,5 @@ char GBASockClient::ReceiveCmd(char* data_in) return data_in[0]; } + +#endif // NO_LINK