meson: Use Python port of glib-mkenums
[glib.git] / gio / meson.build
blob524634edf93a86f07062020b870557b7020e07c4
1 gio_c_args = [
2   '-DG_LOG_DOMAIN="GLib-GIO"',
3   '-DGIO_COMPILATION',
4   '-DGIO_MODULE_DIR="@0@"'.format(glib_giomodulesdir),
7 gio_c_args += glib_hidden_visibility_args
9 # FIXME: Install empty glib_giomodulesdir
11 gnetworking_h_conf = configuration_data()
13 gnetworking_h_wspiapi_include = ''
14 gnetworking_h_nameser_compat_include = ''
16 if host_system == 'windows'
17   # <wspiapi.h> in the Windows SDK and in mingw-w64 has wrappers for
18   # inline workarounds for getaddrinfo, getnameinfo and freeaddrinfo if
19   # they aren't present at run-time (on Windows 2000).
20   gnetworking_h_wspiapi_include = '#include <wspiapi.h>'
21 endif
23 if host_system.contains('android')
24   # Android does not have C_IN in public headers, we define it wherever necessary
25   if not cc.compiles('''#include <sys/types.h>
26                         #include <arpa/nameser.h>
27                         int qclass = C_IN;''',
28                      name : 'C_IN in public headers (no arpa/nameser_compat.h needed)')
29     if cc.compiles('''#include <sys/types.h>
30                       #include <arpa/nameser.h>
31                       #include <arpa/nameser_compat.h>
32                       int qclass = C_IN;''',
33                    name : 'arpa/nameser_compat.h needed for C_IN')
34       gnetworking_h_nameser_compat_include = '#include <arpa/nameser_compat.h>'
35     else
36       error('Could not find required includes for ARPA C_IN')
37     endif
38   endif
39 endif
41 network_libs = [ ]
42 network_args = [ ]
43 if host_system != 'windows'
44   # res_query()
45   res_query_test = '''#include <resolv.h>
46                       int main (int argc, char ** argv) {
47                         return res_query("test", 0, 0, (void *)0, 0);
48                       }'''
49   res_query_test_full = '''#include <sys/types.h>
50                            #include <netinet/in.h>
51                            #include <arpa/nameser.h>
52                         ''' + res_query_test
53   if not cc.links(res_query_test_full, name : 'res_query()')
54     if cc.links(res_query_test_full, args : '-lresolv', name : 'res_query() in -lresolv')
55       network_libs += [ cc.find_library('resolv') ]
56       network_args += [ '-lresolv' ]
57     elif cc.links(res_query_test, args : '-lbind', name : 'res_query() in -lbind')
58       network_libs += [ cc.find_library('bind') ]
59       network_args += [ '-lbind' ]
60     else
61       error('Could not find res_query()')
62     endif
63   endif
65   # socket()
66   socket_test = '''#include <sys/types.h>
67                    #include <sys/socket.h>
68                    int main (int argc, char ** argv) {
69                      return socket(1, 2, 3);
70                    }'''
71   if not cc.links(socket_test, name : 'socket()')
72     if cc.links(socket_test, args : '-lsocket', name : 'socket() in -lsocket')
73       network_libs += [ cc.find_library('socket') ]
74       network_args += [ '-lsocket' ]
75     else
76       error('Could not find socket()')
77     endif
78   endif
80   # res_init()
81   if cc.links('''#include <sys/types.h>
82                  #include <netinet/in.h>
83                  #include <arpa/nameser.h>
84                  #include <resolv.h>
85                  int main (int argc, char ** argv) {
86                    return res_init();
87                  }''', args : network_args, name : 'res_init()')
88     glib_conf.set('HAVE_RES_INIT', 1)
89   endif
91   if cc.compiles('''#include <netinet/in.h>
92                     struct ip_mreqn foo;''',
93                  name : 'struct ip_mreqn')
94     glib_conf.set('HAVE_IP_MREQN', '/**/')
95   endif
96 endif
98 network_args_string = ''
99 foreach arg : network_args
100   network_args_string += arg + ' '
101 endforeach
102 glib_conf.set('NETWORK_LIBS', network_args_string)
104 gnetworking_h_conf.set('WSPIAPI_INCLUDE', gnetworking_h_wspiapi_include)
105 gnetworking_h_conf.set('NAMESER_COMPAT_INCLUDE', gnetworking_h_nameser_compat_include)
107 gnetworking_h = configure_file(input : 'gnetworking.h.in',
108                                output : 'gnetworking.h',
109                                install_dir : join_paths(get_option('includedir'), 'glib-2.0/gio'),
110                                configuration : gnetworking_h_conf)
112 gdbus_headers = files([
113   'gdbusauthobserver.h',
114   'gcredentials.h',
115   'gdbusutils.h',
116   'gdbuserror.h',
117   'gdbusaddress.h',
118   'gdbusconnection.h',
119   'gdbusmessage.h',
120   'gdbusnameowning.h',
121   'gdbusnamewatching.h',
122   'gdbusproxy.h',
123   'gdbusintrospection.h',
124   'gdbusmethodinvocation.h',
125   'gdbusserver.h',
126   'gdbusinterface.h',
127   'gdbusinterfaceskeleton.h',
128   'gdbusobject.h',
129   'gdbusobjectskeleton.h',
130   'gdbusobjectproxy.h',
131   'gdbusobjectmanager.h',
132   'gdbusobjectmanagerclient.h',
133   'gdbusobjectmanagerserver.h',
134   'gtestdbus.h',
137 gdbus_sources = [
138   'gdbusutils.c',
139   'gdbusaddress.c',
140   'gdbusauthobserver.c',
141   'gdbusauth.c',
142   'gdbusauthmechanism.c',
143   'gdbusauthmechanismanon.c',
144   'gdbusauthmechanismexternal.c',
145   'gdbusauthmechanismsha1.c',
146   'gdbuserror.c',
147   'gdbusconnection.c',
148   'gdbusmessage.c',
149   'gdbusnameowning.c',
150   'gdbusnamewatching.c',
151   'gdbusproxy.c',
152   'gdbusprivate.c',
153   'gdbusintrospection.c',
154   'gdbusmethodinvocation.c',
155   'gdbusserver.c',
156   'gdbusinterface.c',
157   'gdbusinterfaceskeleton.c',
158   'gdbusobject.c',
159   'gdbusobjectskeleton.c',
160   'gdbusobjectproxy.c',
161   'gdbusobjectmanager.c',
162   'gdbusobjectmanagerclient.c',
163   'gdbusobjectmanagerserver.c',
164   'gtestdbus.c',
167 # Generate gdbus-codegen
168 subdir('gdbus-2.0/codegen')
170 # Generate xdp-dbus.{c,h}
171 xdp_dbus_generated = custom_target('xdp-dbus',
172     input : ['org.freedesktop.portal.Documents.xml',
173              'org.freedesktop.portal.NetworkMonitor.xml',
174              'org.freedesktop.portal.ProxyResolver.xml'],
175     output : ['xdp-dbus.h', 'xdp-dbus.c'],
176     command : [python, gdbus_codegen,
177                '--interface-prefix', 'org.freedesktop.portal.',
178                '--generate-c-code', '@OUTDIR@/xdp-dbus',
179                '--c-namespace', 'GXdp',
180                '--annotate', 'org.freedesktop.portal.Documents.Add()',
181                              'org.gtk.GDBus.C.UnixFD', 'true',
182                '--annotate', 'org.freedesktop.portal.Documents.AddNamed()',
183                              'org.gtk.GDBus.C.UnixFD', 'true',
184                '@INPUT@'])
186 # Generate gdbus-generated.{c,h}
187 gdbus_daemon_generated = custom_target('gdbus-daemon-generated',
188     input : ['dbus-daemon.xml'],
189     output : ['gdbus-daemon-generated.h', 'gdbus-daemon-generated.c'],
190     command : [python, gdbus_codegen,
191                '--interface-prefix', 'org.',
192                '--generate-c-code', '@OUTDIR@/gdbus-daemon-generated',
193                '--c-namespace', '_G', '@INPUT@'])
195 settings_headers = files([
196   'gsettingsbackend.h',
197   'gsettingsschema.h',
198   'gsettings.h',
201 settings_sources = [
202   'gvdb/gvdb-reader.c',
203   'gdelayedsettingsbackend.c',
204   'gkeyfilesettingsbackend.c',
205   'gmemorysettingsbackend.c',
206   'gnullsettingsbackend.c',
207   'gsettingsbackend.c',
208   'gsettingsschema.c',
209   'gsettings-mapping.c',
210   'gsettings.c',
213 if host_system == 'windows'
214   settings_sources += [ 'gregistrysettingsbackend.c' ]
215 endif
217 # FIXME:
218 #if OS_COCOA
219 #settings_sources += [ 'gnextstepsettingsbackend.c' ]
220 #endif
222 application_headers = files([
223   'gapplication.h',
224   'gapplicationcommandline.h',
226   'gactiongroup.h',
227   'gactionmap.h',
228   'gsimpleactiongroup.h',
229   'gremoteactiongroup.h',
230   'gactiongroupexporter.h',
231   'gdbusactiongroup.h',
232   'gaction.h',
233   'gpropertyaction.h',
234   'gsimpleaction.h',
236   'gmenumodel.h',
237   'gmenu.h',
238   'gmenuexporter.h',
239   'gdbusmenumodel.h',
240   'gnotification.h',
243 application_sources = [
244   'gapplication.c',
245   'gapplicationcommandline.c',
246   'gapplicationimpl-dbus.c',
248   'gactiongroup.c',
249   'gactionmap.c',
250   'gsimpleactiongroup.c',
251   'gremoteactiongroup.c',
252   'gactiongroupexporter.c',
253   'gdbusactiongroup.c',
254   'gaction.c',
255   'gpropertyaction.c',
256   'gsimpleaction.c',
258   'gmenumodel.c',
259   'gmenu.c',
260   'gmenuexporter.c',
261   'gdbusmenumodel.c',
262   'gnotification.c',
263   'gnotificationbackend.c',
266 local_sources = [
267   'ghttpproxy.c',
268   'glocalfile.c',
269   'glocalfileenumerator.c',
270   'glocalfileinfo.c',
271   'glocalfileinputstream.c',
272   'glocalfilemonitor.c',
273   'glocalfileoutputstream.c',
274   'glocalfileiostream.c',
275   'glocalvfs.c',
276   'gsocks4proxy.c',
277   'gsocks4aproxy.c',
278   'gsocks5proxy.c',
279   'thumbnail-verify.c',
282 platform_deps = []
283 internal_deps = []
284 appinfo_sources = []
285 portal_sources = []
286 unix_sources = []
288 if host_system != 'windows'
289   appinfo_sources += ['gdesktopappinfo.c']
290   subdir('xdgmime')
291   internal_deps += [xdgmime_lib]
292   unix_sources = [
293     'gfiledescriptorbased.c',
294     'gunixconnection.c',
295     'gunixcredentialsmessage.c',
296     'gunixfdlist.c',
297     'gunixfdmessage.c',
298     'gunixmount.c',
299     'gunixmounts.c',
300     'gunixsocketaddress.c',
301     'gunixvolume.c',
302     'gunixvolumemonitor.c',
303     'gunixinputstream.c',
304     'gunixoutputstream.c',
305     'gcontenttype.c',
306     'gfdonotificationbackend.c',
307     'ggtknotificationbackend.c',
308   ]
310   portal_sources = [
311     'gdocumentportal.c',
312     'gnetworkmonitorportal.c',
313     'gproxyresolverportal.c',
314     'gportalsupport.c',
315     'gportalnotificationbackend.c',
316     xdp_dbus_generated
317   ]
319   # FIXME
320   #if OS_COCOA
321   #unix_sources += gcocoanotificationbackend.c
322   #endif
324   gio_unix_include_headers = [
325     'gdesktopappinfo.h',
326     'gfiledescriptorbased.h',
327     'gunixconnection.h',
328     'gunixcredentialsmessage.h',
329     'gunixmounts.h',
330     'gunixfdlist.h',
331     'gunixfdmessage.h',
332     'gunixinputstream.h',
333     'gunixoutputstream.h',
334     'gunixsocketaddress.h',
335   ]
336   install_headers(gio_unix_include_headers, subdir : 'gio-unix-2.0/gio')
338   if glib_conf.has('HAVE_NETLINK')
339     unix_sources += [
340       'gnetworkmonitornetlink.c',
341       'gnetworkmonitornm.c',
342     ]
343   endif
344 endif
346 # This is also used by tests/gdbus-daemon, so use files() to include the path
347 gdbus_daemon_sources = [
348   files('gdbusdaemon.c'),
349   gdbus_daemon_generated,
352 win32_sources = gdbus_daemon_sources
353 if host_system == 'windows'
354   appinfo_sources += ['gwin32appinfo.c']
355   platform_deps += [cc.find_library('shlwapi'),
356                     cc.find_library('dnsapi'),
357                     cc.find_library('iphlpapi'),
358                     winsock2]
359   win32_sources += [
360     'gwin32registrykey.c',
361     'gcontenttype-win32.c',
362     'gwin32mount.c',
363     'gwin32volumemonitor.c',
364     'gwin32inputstream.c',
365     'gwin32outputstream.c',
366   ]
368   gio_win32_include_headers = [
369     'gwin32inputstream.h',
370     'gwin32outputstream.h',
371   ]
372   install_headers(gio_win32_include_headers, subdir : 'gio-win32-2.0/gio')
373 endif
375 gio_sources = [
376   'gappinfo.c',
377   'gasynchelper.c',
378   'gasyncinitable.c',
379   'gasyncresult.c',
380   'gbufferedinputstream.c',
381   'gbufferedoutputstream.c',
382   'gbytesicon.c',
383   'gcancellable.c',
384   'gcharsetconverter.c',
385   'gcontextspecificgroup.c',
386   'gconverter.c',
387   'gconverterinputstream.c',
388   'gconverteroutputstream.c',
389   'gcredentials.c',
390   'gdatagrambased.c',
391   'gdatainputstream.c',
392   'gdataoutputstream.c',
393   'gdrive.c',
394   'gdummyfile.c',
395   'gdummyproxyresolver.c',
396   'gdummytlsbackend.c',
397   'gemblem.c',
398   'gemblemedicon.c',
399   'gfile.c',
400   'gfileattribute.c',
401   'gfileenumerator.c',
402   'gfileicon.c',
403   'gfileinfo.c',
404   'gfileinputstream.c',
405   'gfilemonitor.c',
406   'gfilenamecompleter.c',
407   'gfileoutputstream.c',
408   'gfileiostream.c',
409   'gfilterinputstream.c',
410   'gfilteroutputstream.c',
411   'gicon.c',
412   'ginetaddress.c',
413   'ginetaddressmask.c',
414   'ginetsocketaddress.c',
415   'ginitable.c',
416   'ginputstream.c',
417   'gioerror.c',
418   'giomodule.c',
419   'gioscheduler.c',
420   'giostream.c',
421   'gloadableicon.c',
422   'gmount.c',
423   'gmemoryinputstream.c',
424   'gmemoryoutputstream.c',
425   'gmountoperation.c',
426   'gnativevolumemonitor.c',
427   'gnativesocketaddress.c',
428   'gnetworkaddress.c',
429   'gnetworking.c',
430   'gnetworkmonitor.c',
431   'gnetworkmonitorbase.c',
432   'gnetworkservice.c',
433   'goutputstream.c',
434   'gpermission.c',
435   'gpollableinputstream.c',
436   'gpollableoutputstream.c',
437   'gpollableutils.c',
438   'gpollfilemonitor.c',
439   'gproxy.c',
440   'gproxyaddress.c',
441   'gproxyaddressenumerator.c',
442   'gproxyresolver.c',
443   'gresolver.c',
444   'gresource.c',
445   'gresourcefile.c',
446   'gseekable.c',
447   'gsimpleasyncresult.c',
448   'gsimpleiostream.c',
449   'gsimplepermission.c',
450   'gsocket.c',
451   'gsocketaddress.c',
452   'gsocketaddressenumerator.c',
453   'gsocketclient.c',
454   'gsocketconnectable.c',
455   'gsocketconnection.c',
456   'gsocketcontrolmessage.c',
457   'gsocketinputstream.c',
458   'gsocketlistener.c',
459   'gsocketoutputstream.c',
460   'gsubprocesslauncher.c',
461   'gsubprocess.c',
462   'gsocketservice.c',
463   'gsrvtarget.c',
464   'gsimpleproxyresolver.c',
465   'gtask.c',
466   'gtcpconnection.c',
467   'gtcpwrapperconnection.c',
468   'gthreadedsocketservice.c',
469   'gthemedicon.c',
470   'gthreadedresolver.c',
471   'gthreadedresolver.h',
472   'gtlsbackend.c',
473   'gtlscertificate.c',
474   'gtlsclientconnection.c',
475   'gtlsconnection.c',
476   'gtlsdatabase.c',
477   'gtlsfiledatabase.c',
478   'gtlsinteraction.c',
479   'gtlspassword.c',
480   'gtlsserverconnection.c',
481   'gdtlsconnection.c',
482   'gdtlsclientconnection.c',
483   'gdtlsserverconnection.c',
484   'gunionvolumemonitor.c',
485   'gvfs.c',
486   'gvolume.c',
487   'gvolumemonitor.c',
488   'gzlibcompressor.c',
489   'gzlibdecompressor.c',
490   'glistmodel.c',
491   'gliststore.c',
494 gio_sources += appinfo_sources
495 gio_sources += unix_sources
496 gio_sources += win32_sources
497 gio_sources += application_sources
498 gio_sources += settings_sources
499 gio_sources += gdbus_sources
500 gio_sources += portal_sources
501 gio_sources += local_sources
503 MISSING_STUFF = '''
504 if OS_WIN32_AND_DLL_COMPILATION
505 gio_win32_res = gio-win32-res.o
506 gio_win32_res_ldflag = -Wl,$(gio_win32_res)
507 endif
509 gio-win32-res.o: gio.rc
510   '$(WINDRES) gio.rc $@
512 # This is read by gobject-introspection/misc/ and gtk-doc
513 gio-public-headers.txt: Makefile
514   '$(AM_V_GEN) echo $(gioinclude_HEADERS) $(giowin32include_HEADERS) $(giounixinclude_HEADERS) > $@.tmp && mv $@.tmp $@
516 gio.def: libgio-2.0.la
517   '$(AM_V_GEN) dumpbin.exe -exports .libs/libgio-2.0-0.dll | awk 'BEGIN { print "EXPORTS" } / +[[:digit:]]+ +[[:xdigit:]]+ +[[:xdigit:]]+/{ print $$4 }' > gio.def.tmp && mv gio.def.tmp gio.def
519 gio-2.0.lib: libgio-2.0.la gio.def
520   '$(AM_V_GEN) lib.exe -machine:@LIB_EXE_MACHINE_FLAG@ -name:libgio-2.0-$(LT_CURRENT_MINUS_AGE).dll -def:$(builddir)/gio.def -out:$@
523 gio_headers = files([
524   'gappinfo.h',
525   'gasyncinitable.h',
526   'gasyncresult.h',
527   'gbufferedinputstream.h',
528   'gbufferedoutputstream.h',
529   'gbytesicon.h',
530   'gcancellable.h',
531   'gcontenttype.h',
532   'gcharsetconverter.h',
533   'gconverter.h',
534   'gconverterinputstream.h',
535   'gconverteroutputstream.h',
536   'gdatagrambased.h',
537   'gdatainputstream.h',
538   'gdataoutputstream.h',
539   'gdrive.h',
540   'gemblem.h',
541   'gemblemedicon.h',
542   'gfile.h',
543   'gfileattribute.h',
544   'gfileenumerator.h',
545   'gfileicon.h',
546   'gfileinfo.h',
547   'gfileinputstream.h',
548   'gfilemonitor.h',
549   'gfilenamecompleter.h',
550   'gfileoutputstream.h',
551   'gfileiostream.h',
552   'gfilterinputstream.h',
553   'gfilteroutputstream.h',
554   'gicon.h',
555   'ginetaddress.h',
556   'ginetaddressmask.h',
557   'ginetsocketaddress.h',
558   'ginputstream.h',
559   'ginitable.h',
560   'gio.h',
561   'gio-autocleanups.h',
562   'giotypes.h',
563   'gioenums.h',
564   'gioerror.h',
565   'giomodule.h',
566   'gioscheduler.h',
567   'giostream.h',
568   'gloadableicon.h',
569   'gmount.h',
570   'gmemoryinputstream.h',
571   'gmemoryoutputstream.h',
572   'gmountoperation.h',
573   'gnativevolumemonitor.h',
574   'gnetworkaddress.h',
575   'gnetworkmonitor.h',
576   'gnetworkservice.h',
577   'goutputstream.h',
578   'gpermission.h',
579   'gpollableinputstream.h',
580   'gpollableoutputstream.h',
581   'gpollableutils.h',
582   'gproxyaddress.h',
583   'gproxy.h',
584   'gproxyaddressenumerator.h',
585   'gproxyresolver.h',
586   'gresolver.h',
587   'gresource.h',
588   'gseekable.h',
589   'gsimpleasyncresult.h',
590   'gsimpleiostream.h',
591   'gsimplepermission.h',
592   'gsocket.h',
593   'gsocketaddress.h',
594   'gsocketaddressenumerator.h',
595   'gsocketclient.h',
596   'gsocketconnectable.h',
597   'gsocketconnection.h',
598   'gsocketcontrolmessage.h',
599   'gsocketlistener.h',
600   'gsocketservice.h',
601   'gsrvtarget.h',
602   'gsimpleproxyresolver.h',
603   'gtask.h',
604   'gsubprocess.h',
605   'gsubprocesslauncher.h',
606   'gtcpconnection.h',
607   'gtcpwrapperconnection.h',
608   'gthreadedsocketservice.h',
609   'gthemedicon.h',
610   'gtlsbackend.h',
611   'gtlscertificate.h',
612   'gtlsclientconnection.h',
613   'gtlsconnection.h',
614   'gtlsdatabase.h',
615   'gtlsfiledatabase.h',
616   'gtlsinteraction.h',
617   'gtlspassword.h',
618   'gtlsserverconnection.h',
619   'gdtlsconnection.h',
620   'gdtlsclientconnection.h',
621   'gdtlsserverconnection.h',
622   'gvfs.h',
623   'gvolume.h',
624   'gvolumemonitor.h',
625   'gzlibcompressor.h',
626   'gzlibdecompressor.h',
627   'glistmodel.h',
628   'gliststore.h',
631 gio_headers += application_headers
632 gio_headers += settings_headers
633 gio_headers += gdbus_headers
634 install_headers(gio_headers, subdir : 'glib-2.0/gio/')
636 gio_build_mkenum = find_program('build_mkenum.py')
638 gioenumtypes_h = custom_target('gioenumtypes_h',
639   output : 'gioenumtypes.h',
640   input : gio_headers,
641   install : true,
642   install_dir : join_paths(get_option('includedir'), 'glib-2.0/gio'),
643   command : [gio_build_mkenum, python, glib_mkenums,
644              '@OUTPUT@', meson.current_source_dir(),
645              '@INPUT@', gnetworking_h])
647 gioenumtypes_c = custom_target('gioenumtypes_c',
648   output : 'gioenumtypes.c',
649   input : gio_headers,
650   depends : [gioenumtypes_h],
651   command : [gio_build_mkenum, python, glib_mkenums,
652              '@OUTPUT@', meson.current_source_dir(),
653              '@INPUT@', gnetworking_h])
655 gioenumtypes_dep = declare_dependency(sources : [gioenumtypes_h])
657 # inotify
658 if glib_conf.has('HAVE_SYS_INOTIFY_H') and have_func_inotify_init1
659   subdir('inotify')
660   internal_deps += [ inotify_lib ]
661 endif
663 # kevent
664 if have_func_kqueue and have_func_kevent
665   subdir('kqueue')
666   internal_deps += [ kqueue_lib ]
667 endif
669 if host_system == 'windows'
670   subdir('win32')
671   internal_deps += [ giowin32_lib ]
672 endif
674 # FIXME: FAM support
675 #if HAVE_FAM
676 #  subdir('fam')
677 #endif
679 install_data([
680   'completion/gapplication',
681   'completion/gdbus',
682   'completion/gsettings',
683   'completion/gresource'
685 install_dir: join_paths(get_option('datadir'), 'bash-completion/completions'))
687 if enable_dtrace
688   gio_dtrace_obj = dtrace_obj_gen.process('gio_probes.d')
689   gio_dtrace_hdr = dtrace_hdr_gen.process('gio_probes.d')
690 else
691   gio_dtrace_obj = []
692   gio_dtrace_hdr = []
693 endif
695 libgio = shared_library('gio-2.0',
696   gioenumtypes_h, gioenumtypes_c, gnetworking_h, gio_sources,
697   gio_dtrace_hdr, gio_dtrace_obj,
698   version : library_version,
699   soversion : soversion,
700   install : true,
701   include_directories : [configinc, gioinc],
702   link_with : internal_deps,
703   #libgio_2_0_la_LDFLAGS = $(GLIB_LINK_FLAGS)',
704   #  '$(gio_win32_res_ldflag)',
705   #$(SELINUX_LIBS)
706   #$(XATTR_LIBS)
707   dependencies : [libintl, libz_dep, libdl_dep, libmount_dep, libglib_dep,
708                   libgobject_dep, libgmodule_dep] + platform_deps + network_libs,
709   c_args : gio_c_args,
710   # intl.lib is not compatible with SAFESEH
711   link_args : noseh_link_args,
714 libgio_dep = declare_dependency(link_with : libgio,
715   dependencies : [gioenumtypes_dep],
716   # We sadly need to export configinc here because everyone includes <gio/*.h>
717   include_directories : [configinc, gioinc])
719 # Dependencies used by executables below
720 libelf = dependency('libelf', version : '>= 0.8.12', required : false)
721 if libelf.found()
722   glib_conf.set('HAVE_LIBELF', 1)
723 endif
725 gconstructor_as_data_h = custom_target('gconstructor_as_data.h',
726     input : ['data-to-c.py', meson.source_root() + '/glib/gconstructor.h'],
727     output : ['gconstructor_as_data.h'],
728     command : [python, '@INPUT0@', '@INPUT1@', 'gconstructor_code', '@OUTPUT@'])
730 # Several installed executables
731 gio_tool_sources = [
732   'gio-tool.c',
733   'gio-tool.h',
734   'gio-tool-cat.c',
735   'gio-tool-copy.c',
736   'gio-tool-info.c',
737   'gio-tool-list.c',
738   'gio-tool-mime.c',
739   'gio-tool-mkdir.c',
740   'gio-tool-monitor.c',
741   'gio-tool-mount.c',
742   'gio-tool-move.c',
743   'gio-tool-open.c',
744   'gio-tool-rename.c',
745   'gio-tool-remove.c',
746   'gio-tool-save.c',
747   'gio-tool-set.c',
748   'gio-tool-trash.c',
749   'gio-tool-tree.c',
752 # FIXME: are all these HAVE_CONFIG_H needed/used here?
753 executable('gio', gio_tool_sources,
754   install : true,
755   c_args : ['-DHAVE_CONFIG_H=1'] + gio_c_args,
756   # intl.lib is not compatible with SAFESEH
757   link_args : noseh_link_args,
758   dependencies : [libintl, libgio_dep, libgobject_dep, libgmodule_dep, libglib_dep])
760 executable('gresource', 'gresource-tool.c',
761   install : true,
762   c_args : ['-DHAVE_CONFIG_H=1'],
763   # intl.lib is not compatible with SAFESEH
764   link_args : noseh_link_args,
765   dependencies : [libelf, libintl, libgio_dep, libgobject_dep, libgmodule_dep, libglib_dep])
767 executable('gio-querymodules', 'gio-querymodules.c',
768   install : true,
769   c_args : ['-DHAVE_CONFIG_H=1'] + gio_c_args,
770   # intl.lib is not compatible with SAFESEH
771   link_args : noseh_link_args,
772   dependencies : [libgio_dep, libgobject_dep, libgmodule_dep, libglib_dep])
774 executable('glib-compile-schemas',
775   [gconstructor_as_data_h, 'gvdb/gvdb-builder.c', 'glib-compile-schemas.c'],
776   install : true,
777   c_args : ['-DHAVE_CONFIG_H=1'],
778   # intl.lib is not compatible with SAFESEH
779   link_args : noseh_link_args,
780   dependencies : [libintl, libgio_dep, libgobject_dep, libgmodule_dep, libglib_dep])
782 glib_compile_resources = executable('glib-compile-resources',
783   [gconstructor_as_data_h, 'gvdb/gvdb-builder.c', 'glib-compile-resources.c'],
784   install : true,
785   c_args : ['-DHAVE_CONFIG_H=1'] + gio_c_args,
786   # intl.lib is not compatible with SAFESEH
787   link_args : noseh_link_args,
788   dependencies : [libintl, libgio_dep, libgobject_dep, libgmodule_dep, libglib_dep])
790 executable('gsettings', 'gsettings-tool.c',
791   install : true,
792   c_args : ['-DHAVE_CONFIG_H=1'] + gio_c_args,
793   # intl.lib is not compatible with SAFESEH
794   link_args : noseh_link_args,
795   dependencies : [libintl, libgio_dep, libgobject_dep, libgmodule_dep, libglib_dep])
796 install_data('gschema.dtd',
797   install_dir : join_paths(get_option('datadir'), 'glib-2.0/schemas'))
799 install_data(['gschema.loc', 'gschema.its'],
800   install_dir : join_paths(get_option('datadir'), 'gettext/its'))
802 executable('gdbus', 'gdbus-tool.c',
803   install : true,
804   c_args : ['-DHAVE_CONFIG_H=1'] + gio_c_args,
805   # intl.lib is not compatible with SAFESEH
806   link_args : noseh_link_args,
807   dependencies : [libintl, libgio_dep, libgobject_dep, libgmodule_dep, libglib_dep])
809 if host_system != 'windows'
810   executable('gapplication', 'gapplication-tool.c',
811     install : true,
812     c_args : ['-DHAVE_CONFIG_H=1'] + gio_c_args,
813     # intl.lib is not compatible with SAFESEH
814     link_args : noseh_link_args,
815     dependencies : [libintl, libgio_dep, libgobject_dep, libgmodule_dep, libglib_dep])
816 endif
818 if enable_systemtap
819   gio_stp = configure_file(input : 'gio.stp.in',
820     output : '@0@.stp'.format(libgio.full_path().split('/').get(-1)),
821     configuration : stp_cdata,
822     install_dir : tapset_install_dir,
823     install : true)
824 endif
826 if host_system != 'windows'
827   subdir('tests')
828 endif