Do the same thing for gio as we do for dbus

and add -DENABLE_GIO to flags at build-time and an empty gb_LinkTarget__use_gio
when disabled.

Change-Id: I4adf0701a3d490cceecc00f6b81d6416a1e83088
This commit is contained in:
Caolán McNamara 2012-08-30 13:58:15 +01:00
parent f8182a1c53
commit aabc73d04a
4 changed files with 17 additions and 8 deletions

View File

@ -1117,6 +1117,7 @@ endef
endif # SYSTEM_LPSOLVE endif # SYSTEM_LPSOLVE
ifeq ($(ENABLE_GIO),TRUE)
define gb_LinkTarget__use_gio define gb_LinkTarget__use_gio
$(call gb_LinkTarget_set_include,$(1),\ $(call gb_LinkTarget_set_include,$(1),\
@ -1124,10 +1125,22 @@ $(call gb_LinkTarget_set_include,$(1),\
$(GIO_CFLAGS) \ $(GIO_CFLAGS) \
) )
$(call gb_LinkTarget_add_defs,$(1),\
-DENABLE_GIO \
)
$(call gb_LinkTarget_add_libs,$(1),$(GIO_LIBS)) $(call gb_LinkTarget_add_libs,$(1),$(GIO_LIBS))
endef endef
else # ENABLE_GIO
define gb_LinkTarget__use_gio
endef
endif # ENABLE_GIO
define gb_LinkTarget__use_gtk define gb_LinkTarget__use_gtk
$(call gb_LinkTarget_set_include,$(1),\ $(call gb_LinkTarget_set_include,$(1),\
$$(INCLUDE) \ $$(INCLUDE) \

View File

@ -108,13 +108,8 @@ $(eval $(call gb_Library_use_libraries,sd,\
$(eval $(call gb_Library_use_externals,sd,\ $(eval $(call gb_Library_use_externals,sd,\
libxml2 \ libxml2 \
))
ifeq ($(OS),LINUX)
$(eval $(call gb_Library_use_externals,sd,\
gio \ gio \
)) ))
endif
ifeq ($(OS),WNT) ifeq ($(OS),WNT)
$(eval $(call gb_Library_use_libraries,sd,\ $(eval $(call gb_Library_use_libraries,sd,\

View File

@ -9,7 +9,7 @@
#include "BluetoothServer.hxx" #include "BluetoothServer.hxx"
#include <stdio.h> #include <stdio.h>
#ifdef LINUX #if defined(LINUX) && defined(ENABLE_GIO) && defined(ENABLE_DBUS)
#include <glib.h> #include <glib.h>
#include <gio/gio.h> #include <gio/gio.h>
#include <sys/unistd.h> #include <sys/unistd.h>
@ -53,7 +53,7 @@ struct oslSocketImpl {
void BluetoothServer::execute() void BluetoothServer::execute()
{ {
#ifdef LINUX #if defined(LINUX) && defined(ENABLE_GIO) && defined(ENABLE_DBUS)
#ifdef GLIB_VERSION_2_26 #ifdef GLIB_VERSION_2_26
g_type_init(); g_type_init();
GError* aError = NULL; GError* aError = NULL;
@ -218,4 +218,4 @@ void BluetoothServer::setup( std::vector<Communicator*>* pCommunicators )
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -56,6 +56,7 @@ $(eval $(call gb_Library_use_libraries,qstart_gtk,\
)) ))
$(eval $(call gb_Library_use_externals,qstart_gtk,\ $(eval $(call gb_Library_use_externals,qstart_gtk,\
gio \
gtk \ gtk \
libxml2 \ libxml2 \
)) ))