File: meson.build

package info (click to toggle)
glib-d 2.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 252 kB
  • sloc: makefile: 5
file content (69 lines) | stat: -rw-r--r-- 2,185 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
project('GlibD', 'd',
    license: 'LGPL-3.0',
    version: '2.0.0'
)

project_soversion = 0

pkg_conf = import('pkgconfig')

source_root = meson.current_source_dir()
build_root = meson.current_build_dir()
gen_dir = 'generated'

#
# Dependencies
#
glib_dep          = dependency('glib-2.0')
gobject_dep       = dependency('gobject-2.0')
gio_dep           = dependency('gio-2.0')
# The Glib gir files are part of the gobject introspection package.
introspection_dep = dependency('gobject-introspection-1.0')

#
# Build interfaces from GIR
#
gir_to_d_prog = find_program('girtod')
gir_wrap_dir = join_paths(source_root, 'src')
gir_d_intf_dir = join_paths(build_root, gen_dir)

message('Generating D interfaces from GIR...')
girtod_gen = run_command(gir_to_d_prog,
                         '-i', gir_wrap_dir,
                         '-o', gir_d_intf_dir,
                         '--print-files', 'relative,' + source_root)
if girtod_gen.returncode() != 0
    error('Unable to build D intefaces from GIR:\n' + girtod_gen.stderr())
endif

gir_bind_dir = include_directories(gen_dir)
# Enlist D GIR interface sources
gir_binding_sources = girtod_gen.stdout().strip().split('\n')

glibd = library('glibd-2.0',
    [gir_binding_sources],
    include_directories: [gir_bind_dir],
    dependencies: [glib_dep, gobject_dep, gio_dep],
    install: true,
    soversion: project_soversion,
    version: meson.project_version())

install_subdir(join_paths(build_root, gen_dir, 'glib'),    install_dir: 'include/d/glibd-2/')
install_subdir(join_paths(build_root, gen_dir, 'gio'),     install_dir: 'include/d/glibd-2/')
install_subdir(join_paths(build_root, gen_dir, 'gobject'), install_dir: 'include/d/glibd-2/')
install_subdir(join_paths(build_root, gen_dir, 'gtkd'),    install_dir: 'include/d/glibd-2/')

pkg_conf.generate(glibd,
    name: 'glibd-2.0',
    subdirs: 'd/glibd-2',
    version: meson.project_version(),
    requires: [glib_dep, gio_dep, gobject_dep],
    description: 'D bindings for the GLib C Utility Library.')

# for use by others which embed this as subproject
glibd_dep = declare_dependency(
    link_with: [glibd],
    include_directories: [gir_bind_dir]
)

subdir('tests')