meson: define _FILE_OFFSET_BITS=64 for MinGW. See #1476
[glib.git] / gobject / meson.build
blobd8d421df849cef0c25a785e1de0e805e8dede31d
1 gobject_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
23 install_headers(gobject_install_headers, subdir : 'glib-2.0/gobject')
25 gobject_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',
46 if 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]
54 endif
56 if enable_dtrace
57   gobject_dtrace_obj = dtrace_obj_gen.process('gobject_probes.d')
58   gobject_dtrace_hdr = dtrace_hdr_gen.process('gobject_probes.d')
59 else
60   gobject_dtrace_obj = []
61   gobject_dtrace_hdr = []
62 endif
64 libgobject = library('gobject-2.0',
65   gobject_dtrace_obj, gobject_dtrace_hdr,
66   sources : gobject_sources,
67   version : library_version,
68   soversion : soversion,
69   install : true,
70   include_directories : [configinc],
71   dependencies : [libffi_dep, libglib_dep],
72   c_args : ['-DG_LOG_DOMAIN="GLib-GObject"', '-DGOBJECT_COMPILATION'] + glib_hidden_visibility_args,
73   link_args : glib_link_flags,
76 pkg.generate(libraries : libgobject,
77   requires : ['glib-2.0'],
78   version : glib_version,
79   install_dir : glib_pkgconfigreldir,
80   filebase : 'gobject-2.0',
81   name : 'GObject',
82   description : 'GLib Type, Object, Parameter and Signal Library',
85 libgobject_dep = declare_dependency(link_with : libgobject,
86   include_directories : gobjectinc)
88 python_tools = [
89   'glib-genmarshal',
90   'glib-mkenums',
93 python_tools_conf = configuration_data()
94 python_tools_conf.set('VERSION', glib_version)
95 python_tools_conf.set('PYTHON', python_name)
97 foreach tool: python_tools
98   tool_bin = configure_file(
99     input : tool + '.in',
100     output : tool,
101     configuration : python_tools_conf,
102     install : true,
103     install_dir : glib_bindir,
104   )
106   # Set variables for later use
107   set_variable(tool.underscorify(), tool_bin)
108   # Provide tools for others when we're a subproject and they use the Meson GNOME module
109   meson.override_find_program(tool, tool_bin)
110 endforeach
112 executable('gobject-query', 'gobject-query.c',
113   install : true,
114   dependencies : [libglib_dep, libgobject_dep])
116 install_data('gobject_gdb.py', install_dir : join_paths(glib_pkgdatadir, 'gdb'))
117 gdb_conf = configuration_data()
118 gdb_conf.set('datadir', glib_datadir)
119 configure_file(
120   input: 'libgobject-gdb.py.in',
121   output: 'libgobject-2.0.so.@0@-gdb.py'.format(library_version),
122   configuration: gdb_conf,
123   install_dir: gdb_install_dir,
126 if enable_systemtap
127   gobject_stp = configure_file(input : 'gobject.stp.in',
128     output : '@0@.stp'.format(libgobject.full_path().split('/').get(-1)),
129     configuration : stp_cdata,
130     install_dir : tapset_install_dir,
131     install : true)
132 endif
134 subdir('tests')