It might as well go in the AM_CPPFLAGS rather than in the source code.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68852
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
# important note: DBUS_INTERNAL_xxxxx_DEFINITIONS must *not* be set when building dbus-1 library
set (DBUS_INTERNAL_ADD_LIBRARY_OPTIONS STATIC)
set (DBUS_INTERNAL_LIBRARY_DEFINITIONS "-DDBUS_STATIC_BUILD")
-set (DBUS_INTERNAL_CLIENT_DEFINITIONS "-DDBUS_STATIC_BUILD")
+set (DBUS_INTERNAL_CLIENT_DEFINITIONS "-DDBUS_STATIC_BUILD -DDBUS_COMPILATION")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h )
static_cppflags = \
$(AM_CPPFLAGS) \
-DDBUS_STATIC_BUILD \
+ -DDBUS_COMPILATION \
$(NULL)
libdbus_testutils_la_CPPFLAGS = \
#include <config.h>
-#define DBUS_COMPILATION /* this test uses libdbus-internal */
#include <dbus/dbus.h>
#include <dbus/dbus-internals.h>
#include <dbus/dbus-string.h>
#include <glib.h>
#include <glib-object.h>
-#define DBUS_COMPILATION /* this test uses libdbus-internal */
#include <dbus/dbus.h>
#include <dbus/dbus-connection-internal.h>
#include <dbus/dbus-mainloop.h>
#include <glib.h>
-#define DBUS_COMPILATION /* this test uses libdbus-internal */
#include <dbus/dbus.h>
#include <dbus/dbus-sysdeps.h>
#include <config.h>
#include <stdio.h>
#include <stdlib.h>
-#define DBUS_COMPILATION
+
#include <dbus/dbus-internals.h>
#include <dbus/dbus-list.h>
#include <dbus/dbus-memory.h>
#include <config.h>
#include <dbus/dbus.h>
-#define DBUS_COMPILATION /* cheat and use dbus-sysdeps */
#include <dbus/dbus-sysdeps.h>
#include <dbus/dbus-spawn.h>
-#undef DBUS_COMPILATION
#include <stdio.h>
static void
#ifndef TEST_UTILS_H
#define TEST_UTILS_H
-#ifndef DBUS_COMPILATION
-#define DBUS_COMPILATION /* Cheat and use private stuff */
-#endif
#include <dbus/dbus.h>
#include <stdio.h>
#include <stdlib.h>
#include <dbus/dbus-mainloop.h>
#include <dbus/dbus-internals.h>
-#undef DBUS_COMPILATION
dbus_bool_t test_connection_setup (DBusLoop *loop,
DBusConnection *connection);