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