2023-12-20 21:20:04 +01:00
|
|
|
|
|
|
|
|
|
gi_identifier_prefix = 'G'
|
|
|
|
|
gi_symbol_prefix = 'g'
|
|
|
|
|
|
|
|
|
|
gi_gen_shared_sources = [
|
|
|
|
|
# Required to compile gdump
|
|
|
|
|
gmodule_visibility_h,
|
|
|
|
|
]
|
|
|
|
|
|
2024-06-26 13:48:32 +02:00
|
|
|
|
gi_gen_shared_dependencies = [
|
|
|
|
|
# libgirepository is not needed by most of the modules below, but it is needed
|
|
|
|
|
# by the g-ir-scanner generated dumper program. If we don’t explicitly include
|
|
|
|
|
# the local version of it here, Meson will implicitly link against it anyway,
|
|
|
|
|
# and that might pull in a different version, or try to link against a
|
|
|
|
|
# half-built local version as the build ordering dependency tree won’t
|
|
|
|
|
# reflect this relationship.
|
|
|
|
|
libgirepository_dep,
|
|
|
|
|
]
|
|
|
|
|
|
2023-12-20 21:35:40 +01:00
|
|
|
|
gi_gen_env_variables = environment()
|
|
|
|
|
|
2024-05-10 02:42:42 +02:00
|
|
|
|
if 'address' in glib_sanitizers
|
2023-12-20 21:35:40 +01:00
|
|
|
|
gi_gen_env_variables.append(
|
|
|
|
|
'ASAN_OPTIONS', 'verify_asan_link_order=0', separator: ',')
|
|
|
|
|
endif
|
|
|
|
|
|
2024-03-28 11:36:41 +01:00
|
|
|
|
if host_system == 'windows'
|
|
|
|
|
# Use gio-2.0-uninstalled.pc to find the paths where the GLib DLLs (and their dependent non-system
|
|
|
|
|
# DLLs that are built as subprojects) are located
|
|
|
|
|
check_built_dll_paths_cmd = [get_dll_paths_script, '--build-path=@0@'.format(meson.project_build_root())]
|
|
|
|
|
meson_pkgconfig_paths = get_option('pkg_config_path')
|
|
|
|
|
if meson_pkgconfig_paths.length() > 0
|
|
|
|
|
check_built_dll_paths_cmd += '--pkg-config-path=@0@'.format(''.join(meson_pkgconfig_paths))
|
|
|
|
|
endif
|
|
|
|
|
check_built_dll_paths = run_command(
|
|
|
|
|
check_built_dll_paths_cmd,
|
|
|
|
|
capture: true,
|
|
|
|
|
check: true,
|
|
|
|
|
)
|
|
|
|
|
# hmm, no os.pathsep in Meson to make this more portable, if needed?
|
|
|
|
|
gi_scanner_dll_paths = check_built_dll_paths.stdout().strip().split(';')
|
|
|
|
|
|
|
|
|
|
# Also assume the existing paths in %PATH% to be considered for DLLs
|
|
|
|
|
message('Ensure that all of GLib\'s dependent non-system DLLs that are not built')
|
|
|
|
|
message('alongside with GLib can be found in paths in %PATH%')
|
|
|
|
|
message('Check this if building .gir files fail due to \'ImportError: DLL load failed while importing _giscanner\'')
|
|
|
|
|
|
|
|
|
|
gi_gen_env_variables.set('GI_EXTRA_BASE_DLL_DIRS', gi_scanner_dll_paths)
|
|
|
|
|
endif
|
|
|
|
|
|
2023-12-20 03:46:33 +01:00
|
|
|
|
# GLib
|
2024-02-12 16:17:20 +01:00
|
|
|
|
glib_gir_sources = [
|
|
|
|
|
gi_gen_shared_sources,
|
|
|
|
|
glibconfig_h,
|
|
|
|
|
gversionmacros_h,
|
|
|
|
|
glib_visibility_h,
|
|
|
|
|
glib_headers,
|
|
|
|
|
glib_deprecated_headers,
|
|
|
|
|
glib_sub_headers,
|
|
|
|
|
glib_enumtypes_h,
|
|
|
|
|
glib_types_h,
|
|
|
|
|
glib_deprecated_sources,
|
|
|
|
|
glib_sources,
|
2024-05-20 14:34:19 +02:00
|
|
|
|
files('../../glib/docs.c'),
|
2024-02-12 16:17:20 +01:00
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
# For API compatibility reasons, GLib-2.0.gir needs to contain the platform
|
|
|
|
|
# specific APIs which are also present in the (newer) GLibUnix-2.0.gir and
|
|
|
|
|
# GLibWin32-2.0.gir repositories.
|
|
|
|
|
# See https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3892#note_2001361
|
|
|
|
|
# These can be dropped when GLib next breaks API (i.e. with GLib-3.0.gir).
|
|
|
|
|
if host_system == 'windows'
|
|
|
|
|
glib_gir_sources += files('../../glib/gwin32.h')
|
|
|
|
|
else
|
|
|
|
|
glib_gir_sources += files('../../glib/glib-unix.h')
|
|
|
|
|
endif
|
|
|
|
|
|
2023-12-20 03:46:33 +01:00
|
|
|
|
glib_gir = gnome.generate_gir(libglib,
|
2024-02-12 16:17:20 +01:00
|
|
|
|
sources: glib_gir_sources,
|
2023-12-20 03:46:33 +01:00
|
|
|
|
namespace: 'GLib',
|
|
|
|
|
nsversion: '2.0',
|
2023-12-20 21:20:04 +01:00
|
|
|
|
identifier_prefix: gi_identifier_prefix,
|
|
|
|
|
symbol_prefix: gi_symbol_prefix,
|
2023-12-20 03:46:33 +01:00
|
|
|
|
export_packages: 'glib-2.0',
|
|
|
|
|
header: 'glib.h',
|
|
|
|
|
install: true,
|
2024-04-23 11:24:34 +02:00
|
|
|
|
install_dir_gir: glib_girdir,
|
2024-06-26 13:48:32 +02:00
|
|
|
|
dependencies: gi_gen_shared_dependencies + [
|
2023-12-20 03:46:33 +01:00
|
|
|
|
libgobject_dep,
|
|
|
|
|
],
|
2023-12-20 21:35:40 +01:00
|
|
|
|
env: gi_gen_env_variables,
|
2023-12-20 03:46:33 +01:00
|
|
|
|
extra_args: gir_args + [
|
|
|
|
|
'-DGLIB_COMPILATION',
|
|
|
|
|
'-DGETTEXT_PACKAGE="dummy"',
|
|
|
|
|
'--symbol-prefix=glib',
|
|
|
|
|
'--library-path=' + meson.current_build_dir(),
|
|
|
|
|
'--library=gobject-2.0',
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
|
introspection: Generate separate GIR files for platform specific APIs
For both GLib and GIO. (GObject, GIRepository and GModule don’t have any
platform specific APIs.)
This is needed for two reasons:
* If the same GIR file is shipped on multiple platforms, it has no way
to conditionally define/not-define an API based on the platform (like
an `#ifdef` in a C header). So we either end up shipping differing
GIR APIs on different platforms, or shipping a GIR file which
declares APIs which aren’t resolvable by `dlopen()` on certain
platforms, and will cause a language runtime error.
* The API reference documentation is now generated from the GIR, and
similar problems are present there: if the GIR contains different
symbols depending on the platform, there is no way to generate API
documentation for the union of all of them.
The fix is to ensure that there are no conditional symbols in a GIR, by
splitting out the platform specific symbols into platform specific GIR
files. Platform specific documentation can then be generated from these,
in addition to the main, platform agnostic, documentation.
The documentation changes will following in a subsequent commit.
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Helps: #3037
2024-02-06 16:29:30 +01:00
|
|
|
|
if host_system == 'windows'
|
|
|
|
|
glib_win32_gir = gnome.generate_gir(libglib,
|
|
|
|
|
sources: [
|
|
|
|
|
gi_gen_shared_sources,
|
|
|
|
|
glib_win32_headers,
|
|
|
|
|
],
|
|
|
|
|
namespace: 'GLibWin32',
|
|
|
|
|
nsversion: '2.0',
|
|
|
|
|
identifier_prefix: gi_identifier_prefix,
|
|
|
|
|
symbol_prefix: gi_symbol_prefix,
|
|
|
|
|
export_packages: 'glib-2.0',
|
|
|
|
|
header: 'glib.h',
|
|
|
|
|
includes: [ glib_gir[0] ],
|
|
|
|
|
install: true,
|
2024-04-23 11:24:34 +02:00
|
|
|
|
install_dir_gir: glib_girdir,
|
2024-06-26 13:48:32 +02:00
|
|
|
|
dependencies: gi_gen_shared_dependencies + [
|
introspection: Generate separate GIR files for platform specific APIs
For both GLib and GIO. (GObject, GIRepository and GModule don’t have any
platform specific APIs.)
This is needed for two reasons:
* If the same GIR file is shipped on multiple platforms, it has no way
to conditionally define/not-define an API based on the platform (like
an `#ifdef` in a C header). So we either end up shipping differing
GIR APIs on different platforms, or shipping a GIR file which
declares APIs which aren’t resolvable by `dlopen()` on certain
platforms, and will cause a language runtime error.
* The API reference documentation is now generated from the GIR, and
similar problems are present there: if the GIR contains different
symbols depending on the platform, there is no way to generate API
documentation for the union of all of them.
The fix is to ensure that there are no conditional symbols in a GIR, by
splitting out the platform specific symbols into platform specific GIR
files. Platform specific documentation can then be generated from these,
in addition to the main, platform agnostic, documentation.
The documentation changes will following in a subsequent commit.
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Helps: #3037
2024-02-06 16:29:30 +01:00
|
|
|
|
libgobject_dep,
|
|
|
|
|
],
|
|
|
|
|
env: gi_gen_env_variables,
|
|
|
|
|
extra_args: gir_args + [
|
|
|
|
|
'-DGLIB_COMPILATION',
|
|
|
|
|
'-DGETTEXT_PACKAGE="dummy"',
|
|
|
|
|
'--symbol-prefix=glib',
|
2024-02-09 00:58:26 +01:00
|
|
|
|
'--symbol-prefix=g_win32',
|
|
|
|
|
'--identifier-prefix=GWin32',
|
introspection: Generate separate GIR files for platform specific APIs
For both GLib and GIO. (GObject, GIRepository and GModule don’t have any
platform specific APIs.)
This is needed for two reasons:
* If the same GIR file is shipped on multiple platforms, it has no way
to conditionally define/not-define an API based on the platform (like
an `#ifdef` in a C header). So we either end up shipping differing
GIR APIs on different platforms, or shipping a GIR file which
declares APIs which aren’t resolvable by `dlopen()` on certain
platforms, and will cause a language runtime error.
* The API reference documentation is now generated from the GIR, and
similar problems are present there: if the GIR contains different
symbols depending on the platform, there is no way to generate API
documentation for the union of all of them.
The fix is to ensure that there are no conditional symbols in a GIR, by
splitting out the platform specific symbols into platform specific GIR
files. Platform specific documentation can then be generated from these,
in addition to the main, platform agnostic, documentation.
The documentation changes will following in a subsequent commit.
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Helps: #3037
2024-02-06 16:29:30 +01:00
|
|
|
|
'--library-path=' + meson.current_build_dir(),
|
|
|
|
|
'--library=gobject-2.0',
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
else
|
|
|
|
|
glib_unix_gir = gnome.generate_gir(libglib,
|
|
|
|
|
sources: [
|
|
|
|
|
gi_gen_shared_sources,
|
|
|
|
|
glib_unix_headers,
|
|
|
|
|
],
|
|
|
|
|
namespace: 'GLibUnix',
|
|
|
|
|
nsversion: '2.0',
|
|
|
|
|
identifier_prefix: gi_identifier_prefix,
|
|
|
|
|
symbol_prefix: gi_symbol_prefix,
|
|
|
|
|
export_packages: 'glib-2.0',
|
|
|
|
|
header: 'glib.h',
|
|
|
|
|
includes: [ glib_gir[0] ],
|
|
|
|
|
install: true,
|
2024-04-23 11:24:34 +02:00
|
|
|
|
install_dir_gir: glib_girdir,
|
2024-06-26 13:48:32 +02:00
|
|
|
|
dependencies: gi_gen_shared_dependencies + [
|
introspection: Generate separate GIR files for platform specific APIs
For both GLib and GIO. (GObject, GIRepository and GModule don’t have any
platform specific APIs.)
This is needed for two reasons:
* If the same GIR file is shipped on multiple platforms, it has no way
to conditionally define/not-define an API based on the platform (like
an `#ifdef` in a C header). So we either end up shipping differing
GIR APIs on different platforms, or shipping a GIR file which
declares APIs which aren’t resolvable by `dlopen()` on certain
platforms, and will cause a language runtime error.
* The API reference documentation is now generated from the GIR, and
similar problems are present there: if the GIR contains different
symbols depending on the platform, there is no way to generate API
documentation for the union of all of them.
The fix is to ensure that there are no conditional symbols in a GIR, by
splitting out the platform specific symbols into platform specific GIR
files. Platform specific documentation can then be generated from these,
in addition to the main, platform agnostic, documentation.
The documentation changes will following in a subsequent commit.
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Helps: #3037
2024-02-06 16:29:30 +01:00
|
|
|
|
libgobject_dep,
|
|
|
|
|
],
|
|
|
|
|
env: gi_gen_env_variables,
|
|
|
|
|
extra_args: gir_args + [
|
|
|
|
|
'-DGLIB_COMPILATION',
|
|
|
|
|
'-DGETTEXT_PACKAGE="dummy"',
|
|
|
|
|
'--symbol-prefix=glib',
|
2024-02-09 00:58:26 +01:00
|
|
|
|
'--symbol-prefix=g_unix',
|
|
|
|
|
'--identifier-prefix=GUnix',
|
introspection: Generate separate GIR files for platform specific APIs
For both GLib and GIO. (GObject, GIRepository and GModule don’t have any
platform specific APIs.)
This is needed for two reasons:
* If the same GIR file is shipped on multiple platforms, it has no way
to conditionally define/not-define an API based on the platform (like
an `#ifdef` in a C header). So we either end up shipping differing
GIR APIs on different platforms, or shipping a GIR file which
declares APIs which aren’t resolvable by `dlopen()` on certain
platforms, and will cause a language runtime error.
* The API reference documentation is now generated from the GIR, and
similar problems are present there: if the GIR contains different
symbols depending on the platform, there is no way to generate API
documentation for the union of all of them.
The fix is to ensure that there are no conditional symbols in a GIR, by
splitting out the platform specific symbols into platform specific GIR
files. Platform specific documentation can then be generated from these,
in addition to the main, platform agnostic, documentation.
The documentation changes will following in a subsequent commit.
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Helps: #3037
2024-02-06 16:29:30 +01:00
|
|
|
|
'--library-path=' + meson.current_build_dir(),
|
|
|
|
|
'--library=gobject-2.0',
|
|
|
|
|
'--c-include=glib-unix.h',
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
endif
|
|
|
|
|
|
2023-12-20 03:46:33 +01:00
|
|
|
|
# GObject
|
|
|
|
|
gobject_gir = gnome.generate_gir(libgobject,
|
|
|
|
|
sources: [
|
2023-12-20 21:20:04 +01:00
|
|
|
|
gi_gen_shared_sources,
|
2023-12-20 03:46:33 +01:00
|
|
|
|
gobject_visibility_h,
|
|
|
|
|
gobject_install_headers,
|
|
|
|
|
gobject_sources,
|
|
|
|
|
],
|
|
|
|
|
namespace: 'GObject',
|
|
|
|
|
nsversion: '2.0',
|
2023-12-20 21:20:04 +01:00
|
|
|
|
identifier_prefix: gi_identifier_prefix,
|
|
|
|
|
symbol_prefix: gi_symbol_prefix,
|
2023-12-20 03:46:33 +01:00
|
|
|
|
export_packages: 'gobject-2.0',
|
|
|
|
|
header: 'glib-object.h',
|
|
|
|
|
includes: [ glib_gir[0] ],
|
|
|
|
|
install: true,
|
2024-04-23 11:24:34 +02:00
|
|
|
|
install_dir_gir: glib_girdir,
|
2024-06-26 13:48:32 +02:00
|
|
|
|
dependencies: gi_gen_shared_dependencies,
|
2023-12-20 21:35:40 +01:00
|
|
|
|
env: gi_gen_env_variables,
|
2023-12-20 03:46:33 +01:00
|
|
|
|
extra_args: gir_args + [
|
|
|
|
|
'-DGOBJECT_COMPILATION',
|
|
|
|
|
'--symbol-prefix=gobject',
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
# GModule
|
|
|
|
|
gmodule_gir = gnome.generate_gir(libgmodule,
|
|
|
|
|
sources: [
|
2023-12-20 21:20:04 +01:00
|
|
|
|
gi_gen_shared_sources,
|
2023-12-20 03:46:33 +01:00
|
|
|
|
gmoduleconf_h,
|
|
|
|
|
gmodule_h,
|
|
|
|
|
gmodule_c,
|
|
|
|
|
gmodule_deprecated_c,
|
|
|
|
|
gmodule_visibility_h,
|
|
|
|
|
],
|
|
|
|
|
namespace: 'GModule',
|
|
|
|
|
nsversion: '2.0',
|
2023-12-20 21:20:04 +01:00
|
|
|
|
identifier_prefix: gi_identifier_prefix,
|
|
|
|
|
symbol_prefix: gi_symbol_prefix,
|
2023-12-20 03:46:33 +01:00
|
|
|
|
export_packages: 'gmodule-2.0',
|
|
|
|
|
header: 'gmodule.h',
|
|
|
|
|
includes: [ glib_gir[0] ],
|
|
|
|
|
install: true,
|
2024-04-23 11:24:34 +02:00
|
|
|
|
install_dir_gir: glib_girdir,
|
2024-06-26 13:48:32 +02:00
|
|
|
|
dependencies: gi_gen_shared_dependencies + [
|
2023-12-20 03:46:33 +01:00
|
|
|
|
libglib_dep,
|
|
|
|
|
],
|
2023-12-20 21:35:40 +01:00
|
|
|
|
env: gi_gen_env_variables,
|
2023-12-20 03:46:33 +01:00
|
|
|
|
extra_args: gir_args + [
|
|
|
|
|
'-DGMODULE_COMPILATION',
|
|
|
|
|
'-DGETTEXT_PACKAGE="dummy"',
|
|
|
|
|
'--symbol-prefix=gmodule',
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
# Gio
|
|
|
|
|
gio_gir_sources = [
|
2023-12-20 21:20:04 +01:00
|
|
|
|
gi_gen_shared_sources,
|
2023-12-20 03:46:33 +01:00
|
|
|
|
gio_visibility_h,
|
|
|
|
|
gioenumtypes_h,
|
|
|
|
|
gnetworking_h,
|
|
|
|
|
gio_headers,
|
|
|
|
|
gio_base_sources,
|
|
|
|
|
application_sources,
|
|
|
|
|
gdbus_sources,
|
|
|
|
|
contenttype_sources,
|
|
|
|
|
settings_sources,
|
|
|
|
|
]
|
2024-02-12 16:17:20 +01:00
|
|
|
|
gio_gir_packages = [ 'gio-2.0' ]
|
2023-12-20 03:46:33 +01:00
|
|
|
|
gio_gir_args = [
|
|
|
|
|
'-DGIO_COMPILATION',
|
|
|
|
|
'-DG_SETTINGS_ENABLE_BACKEND',
|
|
|
|
|
'--symbol-prefix=gio',
|
|
|
|
|
]
|
|
|
|
|
|
2024-02-12 16:17:20 +01:00
|
|
|
|
# For API compatibility reasons, Gio-2.0.gir needs to contain the platform
|
|
|
|
|
# specific APIs which are also present in the (newer) GioUnix-2.0.gir and
|
|
|
|
|
# GioWin32-2.0.gir repositories.
|
|
|
|
|
# See https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3892#note_2001361
|
|
|
|
|
# These can be dropped when GIO next breaks API (i.e. with Gio-3.0.gir).
|
|
|
|
|
if host_system == 'windows'
|
|
|
|
|
gio_gir_sources += [ gio_win32_include_headers, win32_sources ]
|
|
|
|
|
foreach h: gio_win32_include_headers
|
2024-09-05 13:31:09 +02:00
|
|
|
|
gio_gir_args += '--c-include=' + h.full_path()
|
2024-02-12 16:17:20 +01:00
|
|
|
|
endforeach
|
2024-07-17 10:25:43 +02:00
|
|
|
|
gio_gir_packages += 'gio-windows-2.0'
|
|
|
|
|
gio_gir_args += '--pkg=gio-windows-2.0'
|
2024-02-12 16:17:20 +01:00
|
|
|
|
else
|
|
|
|
|
gio_gir_sources += [ gio_unix_include_headers, unix_sources ]
|
|
|
|
|
foreach h: gio_unix_include_headers
|
2024-09-05 13:31:09 +02:00
|
|
|
|
gio_gir_args += '--c-include=' + h.full_path()
|
2024-02-12 16:17:20 +01:00
|
|
|
|
endforeach
|
|
|
|
|
gio_gir_packages += 'gio-unix-2.0'
|
|
|
|
|
gio_gir_args += '--pkg=gio-unix-2.0'
|
|
|
|
|
endif
|
|
|
|
|
|
2023-12-20 03:46:33 +01:00
|
|
|
|
gio_gir = gnome.generate_gir(libgio,
|
|
|
|
|
sources: gio_gir_sources,
|
|
|
|
|
namespace: 'Gio',
|
|
|
|
|
nsversion: '2.0',
|
2023-12-20 21:20:04 +01:00
|
|
|
|
identifier_prefix: gi_identifier_prefix,
|
|
|
|
|
symbol_prefix: gi_symbol_prefix,
|
2024-02-12 16:17:20 +01:00
|
|
|
|
export_packages: gio_gir_packages,
|
2023-12-20 03:46:33 +01:00
|
|
|
|
header: 'gio/gio.h',
|
|
|
|
|
includes: [ glib_gir[0], gmodule_gir[0], gobject_gir[0] ],
|
|
|
|
|
install: true,
|
2024-04-23 11:24:34 +02:00
|
|
|
|
install_dir_gir: glib_girdir,
|
2024-06-26 13:48:32 +02:00
|
|
|
|
dependencies: gi_gen_shared_dependencies + [
|
2023-12-20 03:46:33 +01:00
|
|
|
|
libglib_dep,
|
|
|
|
|
libgobject_dep,
|
|
|
|
|
libgmodule_dep,
|
|
|
|
|
],
|
2023-12-20 21:35:40 +01:00
|
|
|
|
env: gi_gen_env_variables,
|
2023-12-20 03:46:33 +01:00
|
|
|
|
extra_args: gir_args + gio_gir_args,
|
|
|
|
|
)
|
2024-01-26 10:32:10 +01:00
|
|
|
|
|
introspection: Generate separate GIR files for platform specific APIs
For both GLib and GIO. (GObject, GIRepository and GModule don’t have any
platform specific APIs.)
This is needed for two reasons:
* If the same GIR file is shipped on multiple platforms, it has no way
to conditionally define/not-define an API based on the platform (like
an `#ifdef` in a C header). So we either end up shipping differing
GIR APIs on different platforms, or shipping a GIR file which
declares APIs which aren’t resolvable by `dlopen()` on certain
platforms, and will cause a language runtime error.
* The API reference documentation is now generated from the GIR, and
similar problems are present there: if the GIR contains different
symbols depending on the platform, there is no way to generate API
documentation for the union of all of them.
The fix is to ensure that there are no conditional symbols in a GIR, by
splitting out the platform specific symbols into platform specific GIR
files. Platform specific documentation can then be generated from these,
in addition to the main, platform agnostic, documentation.
The documentation changes will following in a subsequent commit.
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Helps: #3037
2024-02-06 16:29:30 +01:00
|
|
|
|
if host_system == 'windows'
|
|
|
|
|
gio_win32_gir_c_includes = []
|
|
|
|
|
foreach h: gio_win32_include_headers
|
2024-09-05 13:31:09 +02:00
|
|
|
|
gio_win32_gir_c_includes += '--c-include=' + h.full_path()
|
introspection: Generate separate GIR files for platform specific APIs
For both GLib and GIO. (GObject, GIRepository and GModule don’t have any
platform specific APIs.)
This is needed for two reasons:
* If the same GIR file is shipped on multiple platforms, it has no way
to conditionally define/not-define an API based on the platform (like
an `#ifdef` in a C header). So we either end up shipping differing
GIR APIs on different platforms, or shipping a GIR file which
declares APIs which aren’t resolvable by `dlopen()` on certain
platforms, and will cause a language runtime error.
* The API reference documentation is now generated from the GIR, and
similar problems are present there: if the GIR contains different
symbols depending on the platform, there is no way to generate API
documentation for the union of all of them.
The fix is to ensure that there are no conditional symbols in a GIR, by
splitting out the platform specific symbols into platform specific GIR
files. Platform specific documentation can then be generated from these,
in addition to the main, platform agnostic, documentation.
The documentation changes will following in a subsequent commit.
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Helps: #3037
2024-02-06 16:29:30 +01:00
|
|
|
|
endforeach
|
|
|
|
|
|
|
|
|
|
gio_win32_gir = gnome.generate_gir(libgio,
|
|
|
|
|
sources: gio_win32_include_headers + win32_sources,
|
|
|
|
|
namespace: 'GioWin32',
|
|
|
|
|
nsversion: '2.0',
|
|
|
|
|
identifier_prefix: gi_identifier_prefix,
|
|
|
|
|
symbol_prefix: gi_symbol_prefix,
|
2024-07-17 10:25:43 +02:00
|
|
|
|
export_packages: [ 'gio-windows-2.0' ],
|
introspection: Generate separate GIR files for platform specific APIs
For both GLib and GIO. (GObject, GIRepository and GModule don’t have any
platform specific APIs.)
This is needed for two reasons:
* If the same GIR file is shipped on multiple platforms, it has no way
to conditionally define/not-define an API based on the platform (like
an `#ifdef` in a C header). So we either end up shipping differing
GIR APIs on different platforms, or shipping a GIR file which
declares APIs which aren’t resolvable by `dlopen()` on certain
platforms, and will cause a language runtime error.
* The API reference documentation is now generated from the GIR, and
similar problems are present there: if the GIR contains different
symbols depending on the platform, there is no way to generate API
documentation for the union of all of them.
The fix is to ensure that there are no conditional symbols in a GIR, by
splitting out the platform specific symbols into platform specific GIR
files. Platform specific documentation can then be generated from these,
in addition to the main, platform agnostic, documentation.
The documentation changes will following in a subsequent commit.
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Helps: #3037
2024-02-06 16:29:30 +01:00
|
|
|
|
header: 'gio/gio.h',
|
|
|
|
|
includes: [ glib_gir[0], gmodule_gir[0], gobject_gir[0], gio_gir[0] ],
|
|
|
|
|
install: true,
|
2024-04-23 11:24:34 +02:00
|
|
|
|
install_dir_gir: glib_girdir,
|
2024-06-26 13:48:32 +02:00
|
|
|
|
dependencies: gi_gen_shared_dependencies + [
|
introspection: Generate separate GIR files for platform specific APIs
For both GLib and GIO. (GObject, GIRepository and GModule don’t have any
platform specific APIs.)
This is needed for two reasons:
* If the same GIR file is shipped on multiple platforms, it has no way
to conditionally define/not-define an API based on the platform (like
an `#ifdef` in a C header). So we either end up shipping differing
GIR APIs on different platforms, or shipping a GIR file which
declares APIs which aren’t resolvable by `dlopen()` on certain
platforms, and will cause a language runtime error.
* The API reference documentation is now generated from the GIR, and
similar problems are present there: if the GIR contains different
symbols depending on the platform, there is no way to generate API
documentation for the union of all of them.
The fix is to ensure that there are no conditional symbols in a GIR, by
splitting out the platform specific symbols into platform specific GIR
files. Platform specific documentation can then be generated from these,
in addition to the main, platform agnostic, documentation.
The documentation changes will following in a subsequent commit.
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Helps: #3037
2024-02-06 16:29:30 +01:00
|
|
|
|
libglib_dep,
|
|
|
|
|
libgobject_dep,
|
|
|
|
|
libgmodule_dep,
|
|
|
|
|
],
|
|
|
|
|
env: gi_gen_env_variables,
|
2024-02-09 00:58:26 +01:00
|
|
|
|
extra_args: gir_args + gio_gir_args + gio_win32_gir_c_includes + [
|
2024-07-17 10:25:43 +02:00
|
|
|
|
'--pkg=gio-windows-2.0',
|
2024-02-09 00:58:26 +01:00
|
|
|
|
'--symbol-prefix=g_win32',
|
|
|
|
|
'--identifier-prefix=GWin32'
|
|
|
|
|
],
|
introspection: Generate separate GIR files for platform specific APIs
For both GLib and GIO. (GObject, GIRepository and GModule don’t have any
platform specific APIs.)
This is needed for two reasons:
* If the same GIR file is shipped on multiple platforms, it has no way
to conditionally define/not-define an API based on the platform (like
an `#ifdef` in a C header). So we either end up shipping differing
GIR APIs on different platforms, or shipping a GIR file which
declares APIs which aren’t resolvable by `dlopen()` on certain
platforms, and will cause a language runtime error.
* The API reference documentation is now generated from the GIR, and
similar problems are present there: if the GIR contains different
symbols depending on the platform, there is no way to generate API
documentation for the union of all of them.
The fix is to ensure that there are no conditional symbols in a GIR, by
splitting out the platform specific symbols into platform specific GIR
files. Platform specific documentation can then be generated from these,
in addition to the main, platform agnostic, documentation.
The documentation changes will following in a subsequent commit.
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Helps: #3037
2024-02-06 16:29:30 +01:00
|
|
|
|
)
|
2024-05-02 17:03:24 +02:00
|
|
|
|
gio_platform_gir = gio_win32_gir
|
introspection: Generate separate GIR files for platform specific APIs
For both GLib and GIO. (GObject, GIRepository and GModule don’t have any
platform specific APIs.)
This is needed for two reasons:
* If the same GIR file is shipped on multiple platforms, it has no way
to conditionally define/not-define an API based on the platform (like
an `#ifdef` in a C header). So we either end up shipping differing
GIR APIs on different platforms, or shipping a GIR file which
declares APIs which aren’t resolvable by `dlopen()` on certain
platforms, and will cause a language runtime error.
* The API reference documentation is now generated from the GIR, and
similar problems are present there: if the GIR contains different
symbols depending on the platform, there is no way to generate API
documentation for the union of all of them.
The fix is to ensure that there are no conditional symbols in a GIR, by
splitting out the platform specific symbols into platform specific GIR
files. Platform specific documentation can then be generated from these,
in addition to the main, platform agnostic, documentation.
The documentation changes will following in a subsequent commit.
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Helps: #3037
2024-02-06 16:29:30 +01:00
|
|
|
|
else
|
|
|
|
|
gio_unix_gir_c_includes = []
|
|
|
|
|
foreach h: gio_unix_include_headers
|
2024-09-05 13:31:09 +02:00
|
|
|
|
gio_unix_gir_c_includes += '--c-include=' + h.full_path()
|
introspection: Generate separate GIR files for platform specific APIs
For both GLib and GIO. (GObject, GIRepository and GModule don’t have any
platform specific APIs.)
This is needed for two reasons:
* If the same GIR file is shipped on multiple platforms, it has no way
to conditionally define/not-define an API based on the platform (like
an `#ifdef` in a C header). So we either end up shipping differing
GIR APIs on different platforms, or shipping a GIR file which
declares APIs which aren’t resolvable by `dlopen()` on certain
platforms, and will cause a language runtime error.
* The API reference documentation is now generated from the GIR, and
similar problems are present there: if the GIR contains different
symbols depending on the platform, there is no way to generate API
documentation for the union of all of them.
The fix is to ensure that there are no conditional symbols in a GIR, by
splitting out the platform specific symbols into platform specific GIR
files. Platform specific documentation can then be generated from these,
in addition to the main, platform agnostic, documentation.
The documentation changes will following in a subsequent commit.
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Helps: #3037
2024-02-06 16:29:30 +01:00
|
|
|
|
endforeach
|
|
|
|
|
|
|
|
|
|
gio_unix_gir = gnome.generate_gir(libgio,
|
|
|
|
|
sources: gio_unix_include_headers + unix_sources,
|
|
|
|
|
namespace: 'GioUnix',
|
|
|
|
|
nsversion: '2.0',
|
|
|
|
|
identifier_prefix: gi_identifier_prefix,
|
|
|
|
|
symbol_prefix: gi_symbol_prefix,
|
|
|
|
|
export_packages: [ 'gio-unix-2.0' ],
|
|
|
|
|
header: 'gio/gio.h',
|
|
|
|
|
includes: [ glib_gir[0], gmodule_gir[0], gobject_gir[0], gio_gir[0] ],
|
|
|
|
|
install: true,
|
2024-04-23 11:24:34 +02:00
|
|
|
|
install_dir_gir: glib_girdir,
|
2024-06-26 13:48:32 +02:00
|
|
|
|
dependencies: gi_gen_shared_dependencies + [
|
introspection: Generate separate GIR files for platform specific APIs
For both GLib and GIO. (GObject, GIRepository and GModule don’t have any
platform specific APIs.)
This is needed for two reasons:
* If the same GIR file is shipped on multiple platforms, it has no way
to conditionally define/not-define an API based on the platform (like
an `#ifdef` in a C header). So we either end up shipping differing
GIR APIs on different platforms, or shipping a GIR file which
declares APIs which aren’t resolvable by `dlopen()` on certain
platforms, and will cause a language runtime error.
* The API reference documentation is now generated from the GIR, and
similar problems are present there: if the GIR contains different
symbols depending on the platform, there is no way to generate API
documentation for the union of all of them.
The fix is to ensure that there are no conditional symbols in a GIR, by
splitting out the platform specific symbols into platform specific GIR
files. Platform specific documentation can then be generated from these,
in addition to the main, platform agnostic, documentation.
The documentation changes will following in a subsequent commit.
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Helps: #3037
2024-02-06 16:29:30 +01:00
|
|
|
|
libglib_dep,
|
|
|
|
|
libgobject_dep,
|
|
|
|
|
libgmodule_dep,
|
|
|
|
|
],
|
|
|
|
|
env: gi_gen_env_variables,
|
2024-02-09 00:58:26 +01:00
|
|
|
|
extra_args: gir_args + gio_gir_args + gio_unix_gir_c_includes + [
|
|
|
|
|
'--pkg=gio-unix-2.0',
|
|
|
|
|
'--symbol-prefix=g_unix',
|
|
|
|
|
'--identifier-prefix=GUnix'
|
|
|
|
|
],
|
introspection: Generate separate GIR files for platform specific APIs
For both GLib and GIO. (GObject, GIRepository and GModule don’t have any
platform specific APIs.)
This is needed for two reasons:
* If the same GIR file is shipped on multiple platforms, it has no way
to conditionally define/not-define an API based on the platform (like
an `#ifdef` in a C header). So we either end up shipping differing
GIR APIs on different platforms, or shipping a GIR file which
declares APIs which aren’t resolvable by `dlopen()` on certain
platforms, and will cause a language runtime error.
* The API reference documentation is now generated from the GIR, and
similar problems are present there: if the GIR contains different
symbols depending on the platform, there is no way to generate API
documentation for the union of all of them.
The fix is to ensure that there are no conditional symbols in a GIR, by
splitting out the platform specific symbols into platform specific GIR
files. Platform specific documentation can then be generated from these,
in addition to the main, platform agnostic, documentation.
The documentation changes will following in a subsequent commit.
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Helps: #3037
2024-02-06 16:29:30 +01:00
|
|
|
|
)
|
2024-05-02 17:03:24 +02:00
|
|
|
|
gio_platform_gir = gio_unix_gir
|
introspection: Generate separate GIR files for platform specific APIs
For both GLib and GIO. (GObject, GIRepository and GModule don’t have any
platform specific APIs.)
This is needed for two reasons:
* If the same GIR file is shipped on multiple platforms, it has no way
to conditionally define/not-define an API based on the platform (like
an `#ifdef` in a C header). So we either end up shipping differing
GIR APIs on different platforms, or shipping a GIR file which
declares APIs which aren’t resolvable by `dlopen()` on certain
platforms, and will cause a language runtime error.
* The API reference documentation is now generated from the GIR, and
similar problems are present there: if the GIR contains different
symbols depending on the platform, there is no way to generate API
documentation for the union of all of them.
The fix is to ensure that there are no conditional symbols in a GIR, by
splitting out the platform specific symbols into platform specific GIR
files. Platform specific documentation can then be generated from these,
in addition to the main, platform agnostic, documentation.
The documentation changes will following in a subsequent commit.
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Helps: #3037
2024-02-06 16:29:30 +01:00
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
# GIRepository
|
2024-01-26 10:32:10 +01:00
|
|
|
|
libgirepository_gir_sources = [
|
|
|
|
|
gi_visibility_h,
|
|
|
|
|
girepo_headers,
|
|
|
|
|
girepo_sources,
|
|
|
|
|
]
|
|
|
|
|
libgirepository_gir_packages = [ 'girepository-2.0' ]
|
|
|
|
|
libgirepository_gir_args = [
|
|
|
|
|
'-DGI_COMPILATION',
|
|
|
|
|
'--symbol-prefix=gi',
|
|
|
|
|
'--identifier-prefix=GI',
|
|
|
|
|
]
|
|
|
|
|
|
2024-03-28 11:36:41 +01:00
|
|
|
|
gi_libgirepository_gen_env_variables = environment()
|
|
|
|
|
|
|
|
|
|
if host_system == 'windows'
|
|
|
|
|
gi_libgirepository_gen_env_variables.set('GI_EXTRA_BASE_DLL_DIRS', gi_scanner_dll_paths)
|
|
|
|
|
endif
|
|
|
|
|
|
2024-01-26 10:32:10 +01:00
|
|
|
|
girepository_gir = gnome.generate_gir(libgirepository,
|
|
|
|
|
sources: libgirepository_gir_sources,
|
|
|
|
|
namespace: 'GIRepository',
|
|
|
|
|
nsversion: '3.0',
|
|
|
|
|
identifier_prefix: 'GI',
|
|
|
|
|
symbol_prefix: 'gi',
|
|
|
|
|
export_packages: libgirepository_gir_packages,
|
|
|
|
|
header: 'girepository/girepository.h',
|
|
|
|
|
includes: [ glib_gir[0], gmodule_gir[0], gobject_gir[0], gio_gir[0] ],
|
|
|
|
|
install: true,
|
2024-04-23 11:24:34 +02:00
|
|
|
|
install_dir_gir: glib_girdir,
|
2024-06-26 13:48:32 +02:00
|
|
|
|
dependencies: gi_gen_shared_dependencies + [
|
|
|
|
|
libglib_dep,
|
|
|
|
|
libgobject_dep,
|
|
|
|
|
libgmodule_dep,
|
|
|
|
|
libgio_dep,
|
|
|
|
|
],
|
2024-01-26 10:32:10 +01:00
|
|
|
|
extra_args: gir_args + libgirepository_gir_args,
|
2024-03-28 11:36:41 +01:00
|
|
|
|
env: gi_libgirepository_gen_env_variables,
|
2024-01-26 10:32:10 +01:00
|
|
|
|
)
|
|
|
|
|
|