2023-05-10 10:48:59 +00:00
|
|
|
libmks_headers_dir = get_option('includedir') / 'libmks-@0@'.format(api_version)
|
|
|
|
|
|
|
|
libmks_include_directories = [
|
|
|
|
include_directories('.'),
|
|
|
|
include_directories('..'),
|
|
|
|
]
|
|
|
|
|
2023-02-09 02:06:08 +00:00
|
|
|
libmks_sources = [
|
|
|
|
'mks-init.c',
|
|
|
|
'mks-device.c',
|
2023-02-14 05:53:57 +00:00
|
|
|
'mks-display.c',
|
2023-02-09 05:58:35 +00:00
|
|
|
'mks-keyboard.c',
|
|
|
|
'mks-mouse.c',
|
2023-02-09 12:38:48 +00:00
|
|
|
'mks-paintable.c',
|
2023-02-09 02:06:08 +00:00
|
|
|
'mks-screen.c',
|
2023-02-09 23:39:03 +00:00
|
|
|
'mks-screen-attributes.c',
|
2023-02-09 02:06:08 +00:00
|
|
|
'mks-session.c',
|
|
|
|
]
|
|
|
|
|
2023-02-09 05:58:35 +00:00
|
|
|
libmks_headers = [
|
|
|
|
'libmks.h',
|
|
|
|
'mks-device.h',
|
2023-02-14 05:53:57 +00:00
|
|
|
'mks-display.h',
|
2023-02-09 05:58:35 +00:00
|
|
|
'mks-init.h',
|
|
|
|
'mks-keyboard.h',
|
|
|
|
'mks-mouse.h',
|
|
|
|
'mks-screen.h',
|
2023-02-09 23:39:03 +00:00
|
|
|
'mks-screen-attributes.h',
|
2023-02-09 05:58:35 +00:00
|
|
|
'mks-session.h',
|
|
|
|
'mks-types.h',
|
2023-03-29 10:26:26 +00:00
|
|
|
'mks-version-macros.h',
|
2023-02-09 05:58:35 +00:00
|
|
|
]
|
|
|
|
|
2023-05-10 10:48:59 +00:00
|
|
|
libmks_enum_headers = [
|
|
|
|
'mks-mouse.h',
|
|
|
|
'mks-screen.h',
|
|
|
|
'mks-keyboard.h',
|
|
|
|
]
|
|
|
|
|
2023-02-09 02:06:08 +00:00
|
|
|
libmks_private_sources = [
|
2023-02-14 01:38:30 +00:00
|
|
|
'mks-cairo-framebuffer.c',
|
2023-02-15 00:27:09 +00:00
|
|
|
'mks-dmabuf-paintable.c',
|
2023-02-17 19:40:34 +00:00
|
|
|
'mks-display-picture.c',
|
2023-02-14 19:18:48 +00:00
|
|
|
'mks-css.c',
|
2023-02-15 00:27:09 +00:00
|
|
|
'mks-gl-context.c',
|
2023-02-17 23:33:40 +00:00
|
|
|
'mks-inhibitor.c',
|
2023-02-09 02:06:08 +00:00
|
|
|
'mks-read-only-list-model.c',
|
2023-05-08 14:37:49 +00:00
|
|
|
'mks-screen-resizer.c',
|
2023-02-15 18:32:05 +00:00
|
|
|
'mks-util.c',
|
2023-02-09 02:06:08 +00:00
|
|
|
]
|
|
|
|
|
2023-02-10 20:44:50 +00:00
|
|
|
libmks_enums = gnome.mkenums_simple('mks-enums',
|
2023-05-10 10:48:59 +00:00
|
|
|
sources: libmks_enum_headers,
|
2023-02-10 20:44:50 +00:00
|
|
|
install_header: true,
|
2023-05-10 10:48:59 +00:00
|
|
|
install_dir: libmks_headers_dir,
|
2023-02-10 20:44:50 +00:00
|
|
|
identifier_prefix: 'Mks',
|
|
|
|
symbol_prefix: 'mks',
|
|
|
|
)
|
|
|
|
|
2023-02-09 02:06:08 +00:00
|
|
|
# Setup mks-version.h for version checking
|
|
|
|
version_split = meson.project_version().split('.')
|
|
|
|
version_conf = configuration_data()
|
|
|
|
version_conf.set('VERSION', meson.project_version())
|
|
|
|
version_conf.set('MAJOR_VERSION', version_split[0])
|
|
|
|
version_conf.set('MINOR_VERSION', version_split[1])
|
|
|
|
version_conf.set('MICRO_VERSION', version_split[2])
|
2023-02-09 08:23:37 +00:00
|
|
|
mks_version_h = configure_file(
|
2023-02-09 02:06:08 +00:00
|
|
|
input: 'mks-version.h.in',
|
|
|
|
output: 'mks-version.h',
|
|
|
|
configuration: version_conf,
|
|
|
|
install: true,
|
2023-05-10 10:48:59 +00:00
|
|
|
install_dir: libmks_headers_dir,
|
|
|
|
)
|
|
|
|
|
|
|
|
libmks_qemu = gnome.gdbus_codegen('mks-qemu',
|
|
|
|
autocleanup: 'all',
|
|
|
|
interface_prefix: 'org.qemu.Display1.',
|
|
|
|
namespace: 'MksQemu',
|
|
|
|
sources: 'dbus-display1.xml',
|
|
|
|
object_manager: true,
|
|
|
|
)
|
|
|
|
libmks_private_sources += libmks_qemu
|
|
|
|
|
|
|
|
libmks_marshal = gnome.genmarshal('mks-marshal',
|
|
|
|
internal: true,
|
|
|
|
prefix: '_mks_marshal',
|
|
|
|
sources: ['mks-marshal.defs'],
|
|
|
|
valist_marshallers: true,
|
|
|
|
)
|
|
|
|
|
|
|
|
libmks_gresources = gnome.compile_resources(
|
|
|
|
'mks-resources',
|
|
|
|
'mks.gresource.xml',
|
|
|
|
c_name: 'mks',
|
2023-02-09 02:06:08 +00:00
|
|
|
)
|
|
|
|
|
2023-02-09 08:23:37 +00:00
|
|
|
libmks_generated_sources = [
|
2023-05-10 10:48:59 +00:00
|
|
|
libmks_enums[0],
|
|
|
|
libmks_gresources[0],
|
|
|
|
libmks_marshal[0],
|
|
|
|
]
|
|
|
|
|
|
|
|
libmks_generated_headers = [
|
2023-02-09 08:23:37 +00:00
|
|
|
mks_version_h,
|
2023-05-10 10:48:59 +00:00
|
|
|
libmks_enums[1],
|
|
|
|
libmks_gresources[1],
|
|
|
|
libmks_marshal[1],
|
2023-02-09 08:23:37 +00:00
|
|
|
]
|
|
|
|
|
2023-02-09 02:06:08 +00:00
|
|
|
libmks_deps = [
|
2023-02-15 00:27:09 +00:00
|
|
|
libepoxy_dep,
|
2023-02-09 02:06:08 +00:00
|
|
|
libgio_dep,
|
|
|
|
libgiounix_dep,
|
|
|
|
libgtk_dep,
|
2023-02-18 00:27:53 +00:00
|
|
|
|
|
|
|
cc.find_library('m', required: false),
|
2023-02-09 02:06:08 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
libmks = shared_library('mks-' + api_version,
|
2023-05-10 10:48:59 +00:00
|
|
|
libmks_generated_headers +
|
|
|
|
libmks_generated_sources +
|
|
|
|
libmks_private_sources +
|
|
|
|
libmks_sources,
|
|
|
|
include_directories: libmks_include_directories,
|
|
|
|
dependencies: libmks_deps,
|
|
|
|
install: true,
|
2023-05-30 09:07:29 +00:00
|
|
|
version: meson.project_version(),
|
2023-02-09 02:06:08 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
libmks_dep = declare_dependency(
|
2023-05-10 10:48:59 +00:00
|
|
|
sources: libmks_generated_headers,
|
2023-02-09 02:06:08 +00:00
|
|
|
link_with: libmks,
|
|
|
|
dependencies: libmks_deps,
|
2023-05-17 21:35:56 +00:00
|
|
|
include_directories: [include_directories('.')],
|
2023-02-09 02:06:08 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
install_headers(libmks_headers, subdir: 'libmks-@0@'.format(api_version))
|
|
|
|
|
|
|
|
pkg.generate(
|
2023-05-23 10:24:33 +00:00
|
|
|
description: 'A shared library for Mouse, Keyboard, and Screen to QEMU',
|
2023-02-09 02:06:08 +00:00
|
|
|
libraries: libmks,
|
|
|
|
name: 'libmks',
|
|
|
|
filebase: 'libmks-' + api_version,
|
|
|
|
version: meson.project_version(),
|
|
|
|
subdirs: 'libmks-@0@'.format(api_version),
|
|
|
|
requires: ['gio-2.0', 'gio-unix-2.0', 'gtk4'],
|
|
|
|
install_dir: join_paths(get_option('libdir'), 'pkgconfig')
|
|
|
|
)
|
|
|
|
|
2023-03-30 11:14:41 +00:00
|
|
|
if get_option('introspection').allowed()
|
|
|
|
libmks_gir = gnome.generate_gir(libmks,
|
|
|
|
sources: libmks_sources + libmks_headers,
|
|
|
|
nsversion: api_version,
|
|
|
|
namespace: 'Mks',
|
|
|
|
symbol_prefix: 'mks',
|
|
|
|
identifier_prefix: 'Mks',
|
2023-05-10 11:19:29 +00:00
|
|
|
export_packages: 'libmks-@0@'.format(api_version),
|
2023-05-10 10:48:59 +00:00
|
|
|
include_directories: libmks_include_directories,
|
2023-04-17 10:33:33 +00:00
|
|
|
includes: ['Gio-2.0', 'Gtk-4.0'],
|
2023-03-30 11:14:41 +00:00
|
|
|
install: true,
|
2023-04-17 10:33:33 +00:00
|
|
|
header: 'libmks-1.h'
|
2023-03-30 11:14:41 +00:00
|
|
|
)
|
2023-04-17 10:33:33 +00:00
|
|
|
|
|
|
|
if get_option('vapi')
|
|
|
|
libmks_vapi = gnome.generate_vapi('libmks-' + api_version,
|
|
|
|
sources: libmks_gir[0],
|
|
|
|
packages: [ 'gio-2.0', 'gtk4'],
|
|
|
|
install: true,
|
|
|
|
)
|
|
|
|
endif
|
2023-03-30 11:14:41 +00:00
|
|
|
endif
|