mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-11 15:06:14 +01:00
Do not define GIO_COMPILATION for executables
It must only be defined when building libgio. This requires some workaround to allow include of some gio private headers. When GIO_COMPILATION is not defined we cannot include individual gio headers. We workaround that by defining __GIO_GIO_H_INSIDE__ in some places. Also gdbusprivate.h is not an installed header, so it's fine to include it directly.
This commit is contained in:
parent
90fcbc7dfc
commit
8733d172a3
@ -23,10 +23,6 @@
|
||||
#ifndef __G_DBUS_PRIVATE_H__
|
||||
#define __G_DBUS_PRIVATE_H__
|
||||
|
||||
#if !defined (GIO_COMPILATION)
|
||||
#error "gdbusprivate.h is a private header file."
|
||||
#endif
|
||||
|
||||
#include <gio/giotypes.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
@ -21,7 +21,8 @@
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "giomodule.h"
|
||||
|
||||
#include <gio/gio.h>
|
||||
#include "giomodule-priv.h"
|
||||
|
||||
#include <gstdio.h>
|
||||
|
@ -21,6 +21,8 @@
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#define __GIO_GIO_H_INSIDE__
|
||||
#include "giomodule.h"
|
||||
#include "giomodule-priv.h"
|
||||
|
||||
|
@ -24,8 +24,6 @@
|
||||
#include <glib.h>
|
||||
#include <gstdio.h>
|
||||
#include <gi18n.h>
|
||||
#include <gioenums.h>
|
||||
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <locale.h>
|
||||
@ -37,6 +35,8 @@
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
||||
#define __GIO_GIO_H_INSIDE__
|
||||
#include <gio/gioenums.h>
|
||||
#include <gio/gmemoryoutputstream.h>
|
||||
#include <gio/gzlibcompressor.h>
|
||||
#include <gio/gconverteroutputstream.h>
|
||||
|
@ -12,4 +12,4 @@ inotify_lib = static_library('inotify',
|
||||
include_directories : [configinc, glibinc, gmoduleinc],
|
||||
dependencies : [gioenumtypes_dep, libglib_dep, libgobject_dep],
|
||||
pic : true,
|
||||
c_args : gio_c_args)
|
||||
c_args : [gio_c_args, gio_c_args_internal])
|
||||
|
@ -10,4 +10,4 @@ kqueue_lib = static_library('kqueue',
|
||||
include_directories : [configinc, glibinc, gmoduleinc],
|
||||
dependencies : [gioenumtypes_dep],
|
||||
pic : true,
|
||||
c_args : gio_c_args)
|
||||
c_args : [gio_c_args, gio_c_args_internal])
|
||||
|
@ -1,11 +1,14 @@
|
||||
gio_c_args = [
|
||||
'-DG_LOG_DOMAIN="GLib-GIO"',
|
||||
'-DGIO_COMPILATION',
|
||||
'-DGIO_LAUNCH_DESKTOP="@0@"'.format(glib_prefix / multiarch_libexecdir / 'gio-launch-desktop'),
|
||||
'-DGIO_MODULE_DIR="@0@"'.format(glib_giomodulesdir),
|
||||
'-DLOCALSTATEDIR="@0@"'.format(glib_localstatedir),
|
||||
]
|
||||
|
||||
gio_c_args_internal = [
|
||||
'-DGIO_COMPILATION',
|
||||
]
|
||||
|
||||
# FIXME: Install empty glib_giomodulesdir
|
||||
|
||||
gnetworking_h_conf = configuration_data()
|
||||
@ -837,8 +840,8 @@ libgio = library('gio-2.0',
|
||||
libgobject_dep, libgmodule_dep, selinux_dep, xattr_dep,
|
||||
platform_deps, network_libs, libsysprof_capture_dep,
|
||||
gioenumtypes_dep, gvdb_dep],
|
||||
c_args : gio_c_args,
|
||||
objc_args : gio_c_args,
|
||||
c_args : [gio_c_args, gio_c_args_internal],
|
||||
objc_args : [gio_c_args, gio_c_args_internal],
|
||||
gnu_symbol_visibility : 'hidden',
|
||||
# intl.lib is not compatible with SAFESEH
|
||||
link_args : [noseh_link_args, glib_link_flags],
|
||||
|
@ -12,4 +12,4 @@ giowin32_lib = static_library('giowin32',
|
||||
include_directories : [configinc, glibinc, gioinc, gmoduleinc],
|
||||
dependencies : [libintl, gioenumtypes_dep],
|
||||
pic : true,
|
||||
c_args : gio_c_args)
|
||||
c_args : [gio_c_args, gio_c_args_internal])
|
||||
|
Loading…
Reference in New Issue
Block a user