2023-10-25 18:11:08 +02:00
|
|
|
# SPDX-License-Identifier: LGPL-2.1-or-later
|
|
|
|
# SPDX-FileCopyrightText: 2017 Patrick Griffis
|
|
|
|
# SPDX-FileCopyrightText: 2017 Danny Forghieri
|
|
|
|
# SPDX-FileCopyrightText: 2017 Nirbheek Chauhan
|
|
|
|
# SPDX-FileCopyrightText: 2017, 2021, 2022 Emmanuele Bassi
|
|
|
|
# SPDX-FileCopyrightText: 2018 Mathieu Duponchelle
|
|
|
|
# SPDX-FileCopyrightText: 2018, 2019, 2020 Christoph Reiter
|
|
|
|
# SPDX-FileCopyrightText: 2018 Kai Kang
|
|
|
|
# SPDX-FileCopyrightText: 2018 Carlos Garnacho
|
|
|
|
# SPDX-FileCopyrightText: 2018, 2019, 2020 Alexander Kanavin
|
|
|
|
# SPDX-FileCopyrightText: 2019, 2020 Chun-wei Fan
|
|
|
|
# SPDX-FileCopyrightText: 2019 Aaron Boxer
|
|
|
|
# SPDX-FileCopyrightText: 2019 Thibault Saunier
|
|
|
|
# SPDX-FileCopyrightText: 2019 Joshua Watt
|
|
|
|
# SPDX-FileCopyrightText: 2020 Xavier Claessens
|
|
|
|
# SPDX-FileCopyrightText: 2020 Philip Chimento
|
|
|
|
# SPDX-FileCopyrightText: 2021 John Ericson
|
|
|
|
# SPDX-FileCopyrightText: 2021 Cimbali
|
|
|
|
# SPDX-FileCopyrightText: 2021, 2023 Simon McVittie
|
|
|
|
# SPDX-FileCopyrightText: 2022 Andoni Morales Alastruey
|
|
|
|
|
2017-10-23 10:53:04 +02:00
|
|
|
subdir('cmph')
|
|
|
|
|
2023-10-16 16:24:08 +02:00
|
|
|
gir_dir_prefix = get_option('gir_dir_prefix')
|
|
|
|
if gir_dir_prefix == '' or gir_dir_prefix == get_option('datadir')
|
2023-11-08 13:39:19 +01:00
|
|
|
gir_dir_prefix = get_option('datadir')
|
|
|
|
gir_dir_pc_prefix = '${datadir}'
|
2023-10-16 16:24:08 +02:00
|
|
|
else
|
2023-11-08 13:39:19 +01:00
|
|
|
gir_dir_pc_prefix = join_paths('${prefix}', gir_dir_prefix)
|
2023-10-16 16:24:08 +02:00
|
|
|
endif
|
|
|
|
|
|
|
|
glib_girdir = get_option('prefix') / gir_dir_prefix / 'gir-1.0'
|
|
|
|
|
2023-10-25 19:02:03 +02:00
|
|
|
gir_includedir = glib_includedir / 'girepository'
|
|
|
|
|
|
|
|
gi_visibility_h = custom_target(
|
|
|
|
output: 'gi-visibility.h',
|
|
|
|
command: [gen_visibility_macros, meson.project_version(), 'visibility-macros', 'GI', '@OUTPUT@'],
|
|
|
|
install: true,
|
|
|
|
install_dir: gir_includedir,
|
|
|
|
install_tag: 'devel',
|
|
|
|
)
|
|
|
|
|
|
|
|
girepo_headers = files(
|
|
|
|
'giarginfo.h',
|
|
|
|
'gibaseinfo.h',
|
2024-01-17 16:37:47 +01:00
|
|
|
'giboxedinfo.h',
|
2023-10-25 19:02:03 +02:00
|
|
|
'gicallableinfo.h',
|
2023-11-28 18:24:20 +01:00
|
|
|
'gicallbackinfo.h',
|
2023-10-25 19:02:03 +02:00
|
|
|
'giconstantinfo.h',
|
|
|
|
'gienuminfo.h',
|
|
|
|
'gifieldinfo.h',
|
2024-01-17 16:02:05 +01:00
|
|
|
'giflagsinfo.h',
|
2023-10-25 19:02:03 +02:00
|
|
|
'gifunctioninfo.h',
|
|
|
|
'giinterfaceinfo.h',
|
|
|
|
'giobjectinfo.h',
|
|
|
|
'gipropertyinfo.h',
|
|
|
|
'giregisteredtypeinfo.h',
|
|
|
|
'girepository.h',
|
|
|
|
'gisignalinfo.h',
|
|
|
|
'gistructinfo.h',
|
|
|
|
'gitypeinfo.h',
|
|
|
|
'gitypelib.h',
|
|
|
|
'gitypes.h',
|
|
|
|
'giunioninfo.h',
|
2023-11-28 18:24:20 +01:00
|
|
|
'giunresolvedinfo.h',
|
2024-01-17 14:43:58 +01:00
|
|
|
'givalueinfo.h',
|
2023-10-25 19:02:03 +02:00
|
|
|
'givfuncinfo.h',
|
|
|
|
)
|
|
|
|
|
2023-11-08 13:39:19 +01:00
|
|
|
girepo_ffi_headers = [
|
|
|
|
'girffi.h',
|
|
|
|
]
|
|
|
|
|
|
|
|
girepo_ffi_sources = files(
|
|
|
|
'girffi.c',
|
|
|
|
)
|
|
|
|
|
|
|
|
install_headers(girepo_headers + girepo_ffi_headers, install_dir: gir_includedir)
|
2023-10-25 19:02:03 +02:00
|
|
|
|
2023-10-16 16:24:08 +02:00
|
|
|
gir_c_args = [
|
2023-10-25 19:30:38 +02:00
|
|
|
'-DGI_COMPILATION',
|
2023-10-16 16:24:08 +02:00
|
|
|
'-DG_LOG_DOMAIN="GLib-GIRepository"',
|
|
|
|
'-DGIR_SUFFIX="gir-1.0"',
|
|
|
|
'-DGIR_DIR="@0@"'.format(glib_girdir),
|
|
|
|
'-DGOBJECT_INTROSPECTION_LIBDIR="@0@"'.format(glib_libdir),
|
|
|
|
'-DGOBJECT_INTROSPECTION_DATADIR="@0@"'.format(glib_datadir),
|
|
|
|
]
|
|
|
|
|
2019-04-30 10:07:39 +02:00
|
|
|
custom_c_args = []
|
|
|
|
|
|
|
|
if cc.get_id() != 'msvc'
|
|
|
|
custom_c_args = cc.get_supported_arguments([
|
|
|
|
'-Wno-old-style-definition',
|
|
|
|
'-Wno-cast-align',
|
|
|
|
])
|
|
|
|
endif
|
|
|
|
|
2017-10-23 10:53:04 +02:00
|
|
|
girepo_gthash_lib = static_library('girepository-gthash',
|
2023-10-25 19:02:03 +02:00
|
|
|
sources: ['gthash.c', gi_visibility_h],
|
2023-10-25 19:03:10 +02:00
|
|
|
include_directories : [configinc, girepoinc],
|
2023-10-16 16:24:08 +02:00
|
|
|
c_args: gir_c_args + custom_c_args,
|
2017-10-23 10:53:04 +02:00
|
|
|
dependencies: [
|
|
|
|
cmph_dep,
|
2023-10-16 16:24:08 +02:00
|
|
|
libglib_dep,
|
|
|
|
libgmodule_dep,
|
|
|
|
libgobject_dep,
|
2017-10-23 10:53:04 +02:00
|
|
|
],
|
2024-01-19 12:32:44 +01:00
|
|
|
gnu_symbol_visibility : 'hidden',
|
2017-10-23 10:53:04 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
girepo_gthash_dep = declare_dependency(
|
|
|
|
link_with: girepo_gthash_lib,
|
2023-10-16 16:24:08 +02:00
|
|
|
dependencies: [libglib_dep, libgmodule_dep, libgobject_dep],
|
|
|
|
include_directories: [girepoinc],
|
2017-10-23 10:53:04 +02:00
|
|
|
)
|
|
|
|
|
2019-04-30 10:07:39 +02:00
|
|
|
if cc.get_id() != 'msvc'
|
|
|
|
custom_c_args = cc.get_supported_arguments([
|
|
|
|
'-Wno-unused-parameter',
|
|
|
|
'-Wno-duplicated-branches',
|
|
|
|
'-Wno-cast-align',
|
|
|
|
])
|
|
|
|
endif
|
|
|
|
|
2023-11-24 00:24:53 +01:00
|
|
|
libgirepository_internals = static_library('girepository-internals',
|
2017-10-23 10:53:04 +02:00
|
|
|
sources: [
|
|
|
|
'girmodule.c',
|
|
|
|
'girnode.c',
|
|
|
|
'giroffsets.c',
|
|
|
|
'girparser.c',
|
|
|
|
'girwriter.c',
|
2023-10-25 19:41:05 +02:00
|
|
|
gi_visibility_h,
|
2017-10-23 10:53:04 +02:00
|
|
|
],
|
2023-10-16 16:24:08 +02:00
|
|
|
c_args: gir_c_args + custom_c_args,
|
2024-01-19 12:32:44 +01:00
|
|
|
gnu_symbol_visibility : 'hidden',
|
2023-10-25 19:35:05 +02:00
|
|
|
include_directories : [configinc, girepoinc],
|
2017-10-23 10:53:04 +02:00
|
|
|
dependencies: [girepo_gthash_dep, libffi_dep],
|
|
|
|
)
|
|
|
|
|
2023-11-24 00:24:53 +01:00
|
|
|
libgirepository_internals_dep = declare_dependency(
|
|
|
|
link_with: libgirepository_internals,
|
2017-10-23 10:53:04 +02:00
|
|
|
dependencies: libffi_dep,
|
2023-10-16 16:24:08 +02:00
|
|
|
include_directories: [girepoinc],
|
2017-10-23 10:53:04 +02:00
|
|
|
)
|
|
|
|
|
2023-10-16 16:24:08 +02:00
|
|
|
girepo_sources = files(
|
2017-10-23 10:53:04 +02:00
|
|
|
'gdump.c',
|
|
|
|
'giarginfo.c',
|
|
|
|
'gibaseinfo.c',
|
2024-01-17 16:37:47 +01:00
|
|
|
'giboxedinfo.c',
|
2017-10-23 10:53:04 +02:00
|
|
|
'gicallableinfo.c',
|
2023-11-28 18:24:20 +01:00
|
|
|
'gicallbackinfo.c',
|
2017-10-23 10:53:04 +02:00
|
|
|
'giconstantinfo.c',
|
|
|
|
'gienuminfo.c',
|
|
|
|
'gifieldinfo.c',
|
2024-01-17 16:02:05 +01:00
|
|
|
'giflagsinfo.c',
|
2017-10-23 10:53:04 +02:00
|
|
|
'gifunctioninfo.c',
|
|
|
|
'ginvoke.c',
|
|
|
|
'giinterfaceinfo.c',
|
|
|
|
'giobjectinfo.c',
|
|
|
|
'gipropertyinfo.c',
|
|
|
|
'giregisteredtypeinfo.c',
|
|
|
|
'girepository.c',
|
|
|
|
'girffi.c',
|
|
|
|
'gisignalinfo.c',
|
|
|
|
'gistructinfo.c',
|
|
|
|
'gitypeinfo.c',
|
|
|
|
'gitypelib.c',
|
|
|
|
'giunioninfo.c',
|
2023-11-28 18:24:20 +01:00
|
|
|
'giunresolvedinfo.c',
|
2024-01-17 14:43:58 +01:00
|
|
|
'givalueinfo.c',
|
2017-10-23 10:53:04 +02:00
|
|
|
'givfuncinfo.c',
|
2023-10-16 16:24:08 +02:00
|
|
|
)
|
2017-10-23 10:53:04 +02:00
|
|
|
|
2019-04-30 10:07:39 +02:00
|
|
|
if cc.get_id() != 'msvc'
|
|
|
|
custom_c_args = cc.get_supported_arguments([
|
|
|
|
'-Wno-unused-parameter',
|
|
|
|
'-Wno-duplicated-branches',
|
|
|
|
'-Wno-type-limits',
|
|
|
|
'-Wno-cast-align',
|
|
|
|
'-Wno-missing-field-initializers',
|
|
|
|
])
|
|
|
|
endif
|
|
|
|
|
2023-11-24 00:24:53 +01:00
|
|
|
libgirepository = shared_library('girepository-2.0',
|
2023-11-08 13:39:19 +01:00
|
|
|
sources: girepo_sources + girepo_ffi_sources + [gi_visibility_h],
|
2023-10-25 18:28:37 +02:00
|
|
|
include_directories: [configinc, girepoinc],
|
2023-10-16 16:24:08 +02:00
|
|
|
c_args: gir_c_args,
|
|
|
|
version: library_version,
|
|
|
|
soversion: soversion,
|
|
|
|
darwin_versions: darwin_versions,
|
|
|
|
gnu_symbol_visibility: 'hidden',
|
|
|
|
link_args: glib_link_flags,
|
|
|
|
dependencies: [
|
|
|
|
libglib_dep,
|
|
|
|
libgobject_dep,
|
|
|
|
libgmodule_dep,
|
|
|
|
libgio_dep,
|
2023-11-24 00:24:53 +01:00
|
|
|
libgirepository_internals_dep,
|
2023-10-16 16:24:08 +02:00
|
|
|
],
|
2017-10-23 10:53:04 +02:00
|
|
|
install: true,
|
|
|
|
)
|
|
|
|
|
2023-11-24 00:24:53 +01:00
|
|
|
libgirepository_dep = declare_dependency(
|
|
|
|
link_with: libgirepository,
|
2023-10-16 16:24:08 +02:00
|
|
|
dependencies: [libglib_dep, libgobject_dep, libgio_dep, libgmodule_dep],
|
2023-12-14 04:31:56 +01:00
|
|
|
sources: [gi_visibility_h],
|
2023-10-16 16:24:08 +02:00
|
|
|
include_directories: [girepoinc],
|
2017-10-23 10:53:04 +02:00
|
|
|
)
|
|
|
|
|
2023-10-16 16:24:08 +02:00
|
|
|
executable('gi-dump-types',
|
|
|
|
sources: 'gi-dump-types.c',
|
|
|
|
dependencies: [
|
2023-11-24 00:24:53 +01:00
|
|
|
libgirepository_dep,
|
2023-10-16 16:24:08 +02:00
|
|
|
libgiounix_dep,
|
|
|
|
libgiowin32_dep
|
|
|
|
],
|
2017-10-23 10:53:04 +02:00
|
|
|
)
|
|
|
|
|
2023-10-16 16:24:08 +02:00
|
|
|
pkgconfig_variables = [
|
|
|
|
'gidatadir=${datadir}/gobject-introspection-1.0',
|
|
|
|
'girdir=' + gir_dir_pc_prefix / 'gir-1.0',
|
|
|
|
'typelibdir=${libdir}/girepository-1.0',
|
|
|
|
]
|
|
|
|
|
2023-11-24 00:24:53 +01:00
|
|
|
pkg.generate(libgirepository,
|
2023-10-16 16:24:08 +02:00
|
|
|
name: 'girepository',
|
|
|
|
version: glib_version,
|
|
|
|
filebase: 'girepository-2.0',
|
|
|
|
install_dir: glib_pkgconfigreldir,
|
|
|
|
description: 'GObject Introspection repository parser',
|
|
|
|
variables: pkgconfig_variables,
|
|
|
|
libraries: [libglib_dep, libgobject_dep],
|
|
|
|
)
|
2017-10-23 10:53:04 +02:00
|
|
|
|
2023-11-08 13:39:19 +01:00
|
|
|
if enable_gir
|
2024-01-26 10:32:10 +01:00
|
|
|
subdir('introspection')
|
2023-11-08 13:39:19 +01:00
|
|
|
endif
|
2023-11-24 00:20:21 +01:00
|
|
|
|
|
|
|
if build_tests
|
|
|
|
subdir('tests')
|
2023-12-20 21:06:59 +01:00
|
|
|
endif
|
2024-01-16 08:21:02 +01:00
|
|
|
|
|
|
|
subdir('compiler')
|