forked from AuroraMiddleware/gtk
93d795e7c0
cc.has_header doesn't work with subprojects, and all this check does is to make the build fail, so we can just... let the build fail instead.
67 lines
2.0 KiB
Meson
67 lines
2.0 KiB
Meson
print_backends = []
|
|
|
|
printbackends_subdir = 'gtk-4.0/@0@/printbackends'.format(gtk_binary_version)
|
|
printbackends_install_dir = join_paths(get_option('libdir'), printbackends_subdir)
|
|
|
|
printbackends_args = [
|
|
'-DGTK_COMPILATION',
|
|
'-DGTK_DISABLE_DEPRECATION_WARNINGS',
|
|
'-DGTK_PRINT_BACKEND_ENABLE_UNSUPPORTED',
|
|
'-D_GLIB_EXTERN=@0@'.format(visibility_define),
|
|
] + common_cflags
|
|
|
|
cups_dep = dependency('cups', version : '>=2.0', required: get_option('print-cups'))
|
|
if cups_dep.found()
|
|
print_backends += 'cups'
|
|
shared_module('printbackend-cups',
|
|
sources: [
|
|
'gtkprintbackendcups.c',
|
|
'gtkprintercups.c',
|
|
'gtkcupsutils.c',
|
|
'gtkcupssecretsutils.c',
|
|
],
|
|
c_args: printbackends_args,
|
|
dependencies: [libgtk_dep, cups_dep, colord_dep],
|
|
install_dir: printbackends_install_dir,
|
|
install: true,
|
|
)
|
|
else
|
|
# Automatic fall-back to the lpr backend
|
|
print_backends += 'lpr'
|
|
shared_module('printbackend-lpr',
|
|
sources: 'gtkprintbackendlpr.c',
|
|
c_args: printbackends_args,
|
|
dependencies: libgtk_dep,
|
|
install_dir: printbackends_install_dir,
|
|
install: true,
|
|
)
|
|
endif
|
|
|
|
rest_dep = dependency('rest-0.7', required : get_option('print-cloudprint'))
|
|
json_glib_dep = dependency('json-glib-1.0', required : get_option('print-cloudprint'))
|
|
if rest_dep.found() and json_glib_dep.found()
|
|
print_backends += 'cloudprint'
|
|
shared_module('printbackend-cloudprint',
|
|
sources: [
|
|
'gtkprintbackendcloudprint.c',
|
|
'gtkprintercloudprint.c',
|
|
'gtkcloudprintaccount.c',
|
|
],
|
|
c_args: printbackends_args,
|
|
dependencies: [ libgtk_dep, rest_dep, json_glib_dep ],
|
|
install_dir: printbackends_install_dir,
|
|
install: true)
|
|
endif
|
|
|
|
# The 'file' print backend cannot be disabled
|
|
print_backends += 'file'
|
|
shared_module('printbackend-file',
|
|
sources: 'gtkprintbackendfile.c',
|
|
c_args: printbackends_args,
|
|
dependencies: libgtk_dep,
|
|
install_dir: printbackends_install_dir,
|
|
install: true,
|
|
)
|
|
|
|
cdata.set_quoted('GTK_PRINT_BACKENDS', ','.join(print_backends))
|