• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1gobject_install_headers = files(
2  'gobject-autocleanups.h',
3  'glib-types.h',
4  'gbinding.h',
5  'gboxed.h',
6  'gclosure.h',
7  'genums.h',
8  'gmarshal.h',
9  'gobject.h',
10  'gparam.h',
11  'gparamspecs.h',
12  'gsignal.h',
13  'gsourceclosure.h',
14  'gtype.h',
15  'gtypemodule.h',
16  'gtypeplugin.h',
17  'gvalue.h',
18  'gvaluearray.h',
19  'gvaluecollector.h',
20  'gvaluetypes.h',
21  'gobjectnotifyqueue.c', # sic
22)
23install_headers(gobject_install_headers, subdir : 'glib-2.0/gobject')
24
25gobject_sources = files(
26  'gatomicarray.c',
27  'gbinding.c',
28  'gboxed.c',
29  'gclosure.c',
30  'genums.c',
31  'gmarshal.c',
32  'gobject.c',
33  'gparam.c',
34  'gparamspecs.c',
35  'gsignal.c',
36  'gsourceclosure.c',
37  'gtype.c',
38  'gtypemodule.c',
39  'gtypeplugin.c',
40  'gvalue.c',
41  'gvaluearray.c',
42  'gvaluetransform.c',
43  'gvaluetypes.c',
44)
45
46if host_system == 'windows'
47  gobject_win_rc = configure_file(
48    input: 'gobject.rc.in',
49    output: 'gobject.rc',
50    configuration: glibconfig_conf,
51  )
52  gobject_win_res = windows.compile_resources(gobject_win_rc)
53  gobject_sources += [gobject_win_res]
54endif
55
56if enable_dtrace
57  gobject_dtrace_obj = dtrace_obj_gen.process('gobject_probes.d')
58  gobject_dtrace_hdr = dtrace_hdr_gen.process('gobject_probes.d')
59else
60  gobject_dtrace_obj = []
61  gobject_dtrace_hdr = []
62endif
63
64python_tools = [
65  'glib-genmarshal',
66  'glib-mkenums',
67]
68
69python_tools_conf = configuration_data()
70python_tools_conf.set('VERSION', glib_version)
71python_tools_conf.set('PYTHON', python_name)
72
73foreach tool: python_tools
74  tool_bin = configure_file(
75    input : tool + '.in',
76    output : tool,
77    configuration : python_tools_conf,
78    install_dir : glib_bindir,
79  )
80
81  # Set variables for later use
82  set_variable(tool.underscorify(), tool_bin)
83  # Provide tools for others when we're a subproject and they use the Meson GNOME module
84  meson.override_find_program(tool, tool_bin)
85endforeach
86
87# Generate a header file containing the GObject enum types for the enums defined
88# in libglib.
89#
90# For now, we only include gunicode.h here, since GScriptType is needed for
91# Pango. More headers can be added as needed in future.
92#
93# We can't use gnome.mkenums() because the GNOME module looks for glib-mkenums
94# in PATH, which means you can't bootstrap glib with its own glib-mkenums.
95glib_enumtypes_input_headers = files(
96  '../glib/gunicode.h',
97)
98
99glib_enumtypes_h = custom_target('glib_enumtypes_h',
100  output : 'glib-enumtypes.h',
101  capture : true,
102  input : glib_enumtypes_input_headers,
103  install : true,
104  install_dir : join_paths(get_option('includedir'), 'glib-2.0/gobject'),
105  command : [python, glib_mkenums,
106             '--template', files('glib-enumtypes.h.template'),
107             '@INPUT@'])
108
109glib_enumtypes_c = custom_target('glib_enumtypes_c',
110  output : 'glib-enumtypes.c',
111  capture : true,
112  input : glib_enumtypes_input_headers,
113  depends : [glib_enumtypes_h],
114  command : [python, glib_mkenums,
115             '--template', files('glib-enumtypes.c.template'),
116             '@INPUT@'])
117
118glib_enumtypes_dep = declare_dependency(sources : [glib_enumtypes_h])
119
120libgobject = library('gobject-2.0',
121  gobject_dtrace_obj, gobject_dtrace_hdr, glib_enumtypes_h, glib_enumtypes_c,
122  sources : gobject_sources,
123  version : library_version,
124  soversion : soversion,
125  darwin_versions : darwin_versions,
126  install : true,
127  include_directories : [configinc],
128  dependencies : [libffi_dep, libglib_dep],
129  c_args : ['-DG_LOG_DOMAIN="GLib-GObject"', '-DGOBJECT_COMPILATION'] + glib_hidden_visibility_args,
130  link_args : glib_link_flags,
131)
132
133pkg.generate(libgobject,
134  requires : ['glib-2.0'],
135  version : glib_version,
136  install_dir : glib_pkgconfigreldir,
137  filebase : 'gobject-2.0',
138  name : 'GObject',
139  description : 'GLib Type, Object, Parameter and Signal Library',
140)
141
142libgobject_dep = declare_dependency(link_with : libgobject,
143  include_directories : [gobjectinc],
144  dependencies : [libglib_dep, glib_enumtypes_dep])
145
146if meson.version().version_compare('>=0.54.0')
147  meson.override_dependency('gobject-2.0', libgobject_dep)
148endif
149
150executable('gobject-query', 'gobject-query.c',
151  install : true,
152  dependencies : [libglib_dep, libgobject_dep])
153
154install_data('gobject_gdb.py', install_dir : join_paths(glib_pkgdatadir, 'gdb'))
155gdb_conf = configuration_data()
156gdb_conf.set('datadir', glib_datadir)
157configure_file(
158  input: 'libgobject-gdb.py.in',
159  output: 'libgobject-2.0.so.@0@-gdb.py'.format(library_version),
160  configuration: gdb_conf,
161  install_dir: gdb_install_dir,
162)
163
164if enable_systemtap
165  gobject_stp = configure_file(input : 'gobject.stp.in',
166    output : '@0@.stp'.format(libgobject.full_path().split('/').get(-1)),
167    configuration : stp_cdata,
168    install_dir : tapset_install_dir,
169  )
170endif
171
172if build_tests
173  subdir('tests')
174endif
175