CMAKE: Allow building without SFML

This commit is contained in:
bgk 2011-02-20 12:22:58 +00:00
parent 573aaca70b
commit 6c80badb98
4 changed files with 28 additions and 6 deletions

View File

@ -41,7 +41,7 @@ FIND_PACKAGE ( ZLIB REQUIRED )
FIND_PACKAGE ( PNG REQUIRED ) FIND_PACKAGE ( PNG REQUIRED )
FIND_PACKAGE ( OpenGL REQUIRED ) FIND_PACKAGE ( OpenGL REQUIRED )
FIND_PACKAGE ( SDL REQUIRED ) FIND_PACKAGE ( SDL REQUIRED )
FIND_PACKAGE ( SFML REQUIRED ) FIND_PACKAGE ( SFML )
# Disable looking for GTK if not going to build the GTK frontend # Disable looking for GTK if not going to build the GTK frontend
# so that pkg-config is not required # so that pkg-config is not required
@ -50,6 +50,7 @@ IF(NOT NO_GTK)
# These dependencies require pkg-config to be found # These dependencies require pkg-config to be found
PKG_CHECK_MODULES ( GTKMM gtkmm-2.4 ) PKG_CHECK_MODULES ( GTKMM gtkmm-2.4 )
PKG_CHECK_MODULES ( GDKMM gdkmm-2.4 )
PKG_CHECK_MODULES ( GLIBMM glibmm-2.4 ) PKG_CHECK_MODULES ( GLIBMM glibmm-2.4 )
PKG_CHECK_MODULES ( GIOMM giomm-2.4 ) PKG_CHECK_MODULES ( GIOMM giomm-2.4 )
PKG_CHECK_MODULES ( GTKGLMM gtkglextmm-x11-1.2 ) 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='') 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 debugger is enabled by default
# The SDL port can't be built without debugging support # The SDL port can't be built without debugging support
IF( NO_DEBUGGER ) IF( NO_DEBUGGER )
@ -284,6 +291,7 @@ IF( CAN_BUILD_GVBAM )
${GLIBMM_INCLUDE_DIRS} ${GLIBMM_INCLUDE_DIRS}
${GIOMM_INCLUDE_DIRS} ${GIOMM_INCLUDE_DIRS}
${GTKMM_INCLUDE_DIRS} ${GTKMM_INCLUDE_DIRS}
${GDKMM_INCLUDE_DIRS}
${GTKGLMM_INCLUDE_DIRS} ${GTKGLMM_INCLUDE_DIRS}
) )

View File

@ -1,5 +1,12 @@
// This file was written by denopqrihg // 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 #ifdef _WIN32
#include "../win32/stdafx.h" #include "../win32/stdafx.h"
#include "../win32/VBA.h" #include "../win32/VBA.h"
@ -18,14 +25,9 @@
int linktime = 0; int linktime = 0;
// Joybus
bool gba_joybus_enabled = false;
GBASockClient* dol = NULL; GBASockClient* dol = NULL;
sf::IPAddress joybusHostAddr = sf::IPAddress::LocalHost; 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 #ifdef _MSC_VER
// Hodgepodge // Hodgepodge
u8 tspeed = 3; u8 tspeed = 3;
@ -1219,3 +1221,7 @@ void LinkSSend(u16 value){
} }
#endif // _MSC_VER #endif // _MSC_VER
#else // NO_LINK
void JoyBusUpdate(int ticks) {}
#endif // NO_LINK

View File

@ -1,6 +1,8 @@
#pragma once #pragma once
#ifndef NO_LINK
#include <SFML/Network.hpp> #include <SFML/Network.hpp>
#endif
#define LINK_PARENTLOST 0x80 #define LINK_PARENTLOST 0x80
#define UNSUPPORTED -1 #define UNSUPPORTED -1
@ -116,7 +118,9 @@ typedef struct {
#endif #endif
extern bool gba_joybus_enabled; extern bool gba_joybus_enabled;
#ifndef NO_LINK
extern sf::IPAddress joybusHostAddr; extern sf::IPAddress joybusHostAddr;
#endif
extern void JoyBusConnect(); extern void JoyBusConnect();
extern void JoyBusShutdown(); extern void JoyBusShutdown();
extern void JoyBusUpdate(int ticks); extern void JoyBusUpdate(int ticks);

View File

@ -1,3 +1,5 @@
#ifndef NO_LINK
#include "GBASockClient.h" #include "GBASockClient.h"
// Currently only for Joybus communications // Currently only for Joybus communications
@ -36,3 +38,5 @@ char GBASockClient::ReceiveCmd(char* data_in)
return data_in[0]; return data_in[0];
} }
#endif // NO_LINK