[PATCH RFC weston 4/4] Add Meson build system
Daniel Stone
daniels at collabora.com
Tue Nov 29 17:00:03 UTC 2016
Meson is a Python-based build system with multiple output backends,
including Ninja and Make. It's really very fast.
More information at http://mesonbuild.com
Signed-off-by: Daniel Stone <daniels at collabora.com>
---
clients/meson.build | 267 ++++++++++++++++++++++++++++++
compositor/meson.build | 135 ++++++++++++++++
desktop-shell/meson.build | 31 ++++
fullscreen-shell/meson.build | 18 +++
ivi-shell/meson.build | 61 +++++++
libweston-desktop/meson.build | 44 +++++
libweston/git-version.h.meson | 1 +
libweston/meson.build | 369 ++++++++++++++++++++++++++++++++++++++++++
meson.build | 114 +++++++++++++
meson_options.txt | 126 +++++++++++++++
protocol/meson.build | 101 ++++++++++++
shared/meson.build | 33 ++++
tests/meson.build | 269 ++++++++++++++++++++++++++++++
xwayland/meson.build | 34 ++++
14 files changed, 1603 insertions(+)
create mode 100644 clients/meson.build
create mode 100644 compositor/meson.build
create mode 100644 desktop-shell/meson.build
create mode 100644 fullscreen-shell/meson.build
create mode 100644 ivi-shell/meson.build
create mode 100644 libweston-desktop/meson.build
create mode 100644 libweston/git-version.h.meson
create mode 100644 libweston/meson.build
create mode 100644 meson.build
create mode 100644 meson_options.txt
create mode 100644 protocol/meson.build
create mode 100644 shared/meson.build
create mode 100644 tests/meson.build
create mode 100644 xwayland/meson.build
diff --git a/clients/meson.build b/clients/meson.build
new file mode 100644
index 0000000..dd2f99d
--- /dev/null
+++ b/clients/meson.build
@@ -0,0 +1,267 @@
+srcs_toytoolkit = [
+ 'window.c',
+ '../shared/xalloc.c',
+ '../shared/os-compatibility.c',
+ '../shared/config-parser.c',
+ '../shared/option-parser.c',
+ gen_xdg_shell6_client,
+ gen_xdg_shell6_impl,
+ gen_text_cursor_pos_client,
+ gen_text_cursor_pos_impl,
+ gen_rel_ptr_client,
+ gen_rel_ptr_impl,
+ gen_ptr_constraints_client,
+ gen_ptr_constraints_impl,
+ gen_ivi_application_client,
+ gen_ivi_application_impl,
+]
+deps_toytoolkit = [
+ dep_wayland_client,
+ dep_lib_cairo_shared,
+ dep_xkbcommon,
+ dependency('wayland-cursor'),
+ cc.find_library('util'),
+]
+libtoytoolkit = static_library('toytoolkit',
+ srcs_toytoolkit,
+ include_directories: include_directories('..', '../shared'),
+ dependencies: deps_toytoolkit,
+ install: false,
+)
+dep_toytoolkit = declare_dependency(
+ link_with: libtoytoolkit,
+ dependencies: deps_toytoolkit,
+)
+
+if get_option('clients_simple')
+ srcs_simple = [
+ '../shared/os-compatibility.c',
+ gen_xdg_shell6_client,
+ gen_xdg_shell6_impl,
+ gen_fullscreen_shell_client,
+ gen_fullscreen_shell_impl,
+ gen_ivi_application_client,
+ gen_ivi_application_impl,
+ ]
+ deps_simple = [
+ dep_wayland_client,
+ dep_xkbcommon,
+ dependency('wayland-cursor'),
+ ]
+
+ executable('weston-simple-damage',
+ 'simple-damage.c',
+ gen_viewporter_client,
+ gen_viewporter_impl,
+ srcs_simple,
+ include_directories: include_directories('..'),
+ dependencies: deps_simple,
+ install: false
+ )
+ executable('weston-simple-im',
+ 'simple-im.c',
+ gen_input_method_client,
+ gen_input_method_impl,
+ srcs_simple,
+ include_directories: include_directories('..'),
+ dependencies: [
+ deps_simple,
+ dependency('cairo'),
+ ],
+ install: false
+ )
+ executable('weston-simple-shm',
+ 'simple-shm.c',
+ srcs_simple,
+ include_directories: include_directories('..'),
+ dependencies: deps_simple,
+ install: false
+ )
+ executable('weston-simple-touch',
+ 'simple-touch.c',
+ srcs_simple,
+ include_directories: include_directories('..'),
+ dependencies: deps_simple,
+ install: false
+ )
+
+ if get_option('clients_dmabuf_drm')
+ executable('weston-simple-dmabuf-intel',
+ 'simple-dmabuf-intel.c',
+ gen_dmabuf_client,
+ gen_dmabuf_impl,
+ srcs_simple,
+ include_directories: include_directories('..'),
+ dependencies: [
+ deps_simple,
+ dependency('libdrm'),
+ dependency('libdrm_intel'),
+ ],
+ install: false
+ )
+ endif
+
+ if get_option('clients_dmabuf_v4l2')
+ executable('weston-simple-dmabuf-v4l2',
+ 'simple-dmabuf-v4l.c',
+ gen_dmabuf_client,
+ gen_dmabuf_impl,
+ srcs_simple,
+ include_directories: include_directories('..'),
+ dependencies: [
+ deps_simple,
+ dependency('libdrm'),
+ ],
+ install: false
+ )
+ endif
+
+ if get_option('clients_egl')
+ executable('weston-simple-egl',
+ 'simple-egl.c',
+ srcs_simple,
+ include_directories:
+ include_directories('..', '../shared'),
+ dependencies: [
+ deps_simple,
+ dep_libm,
+ dependency('egl'),
+ dependency('glesv2'),
+ dependency('wayland-egl'),
+ ],
+ install: false
+ )
+ endif
+endif
+
+if get_option('clients_suite')
+ toytoolkit_clients = [
+ [
+ 'calibrator',
+ [ '../shared/matrix.c' ]
+ ],
+ ['clickdot'],
+ [
+ 'cliptest',
+ [ '../libweston/vertex-clipping.c' ]
+ ],
+ ['confine'],
+ ['dnd'],
+ [
+ 'editor',
+ [
+ gen_text_input_client,
+ gen_text_input_impl,
+ ],
+ [ dependency('pangocairo') ]
+ ],
+ ['eventdemo'],
+ ['flower'],
+ [
+ 'fullscreen',
+ [
+ gen_fullscreen_shell_client,
+ gen_fullscreen_shell_impl,
+ ]
+ ],
+ ['image'],
+ [
+ 'weston-info',
+ [
+ gen_presentation_time_client,
+ gen_presentation_time_impl,
+ ]
+ ],
+ ['resizor'],
+ [
+ 'scaler',
+ [
+ gen_viewporter_client,
+ gen_viewporter_impl,
+ ]
+ ],
+ ['smoke'],
+ ['stacking'],
+ ['terminal'],
+ ['transformed'],
+ ]
+
+ foreach t : toytoolkit_clients
+ t_srcs = [ '@0 at .c'.format(t.get(0)) ]
+ if t.length() > 1
+ t_srcs += t.get(1)
+ endif
+
+ t_deps = [ dep_toytoolkit ]
+ if t.length() > 2
+ t_deps += t.get(2)
+ endif
+
+ if t.get(0).startswith('weston-')
+ t_name = t.get(0)
+ else
+ t_name = 'weston- at 0@'.format(t.get(0))
+ endif
+
+ executable('weston- at 0@'.format(t.get(0)),
+ t_srcs,
+ include_directories:
+ include_directories('..', '../shared'),
+ dependencies: t_deps,
+ install: false
+ )
+ endforeach
+endif
+
+
+if get_option('shell_desktop')
+ exe_keyboard = executable('weston-keyboard',
+ 'keyboard.c',
+ gen_text_input_client,
+ gen_text_input_impl,
+ gen_input_method_client,
+ gen_input_method_impl,
+ include_directories: include_directories('..'),
+ dependencies: dep_toytoolkit,
+ install_dir: get_option('libexecdir'),
+ install: true
+ )
+ env_modmap += 'weston-keyboard=@0@;'.format(exe_keyboard.full_path())
+
+ exe_shooter = executable('weston-screenshooter',
+ 'screenshot.c',
+ gen_shooter_client,
+ gen_shooter_impl,
+ include_directories: include_directories('..'),
+ dependencies: dep_toytoolkit,
+ install_dir: get_option('libexecdir'),
+ install: true
+ )
+ env_modmap += 'weston-screenshooter=@0@;'.format(exe_shooter.full_path())
+
+ exe_shell_desktop = executable('weston-desktop-shell',
+ 'desktop-shell.c',
+ gen_desktop_shell_client,
+ gen_desktop_shell_impl,
+ include_directories: include_directories('..'),
+ dependencies: dep_toytoolkit,
+ install_dir: get_option('libexecdir'),
+ install: true
+ )
+ env_modmap += 'weston-desktop-shell=@0@;'.format(exe_shell_desktop.full_path())
+endif
+
+
+if get_option('shell_ivi')
+ exe_shell_ivi_ui = executable('weston-ivi-shell-user-interface',
+ 'ivi-shell-user-interface.c',
+ gen_ivi_hmi_client,
+ gen_ivi_hmi_impl,
+ gen_ivi_application_client,
+ gen_ivi_application_impl,
+ include_directories: include_directories('..'),
+ dependencies: dep_toytoolkit,
+ install_dir: get_option('libexecdir')
+ )
+ env_modmap += 'weston-ivi-shell-user-interface=@0@;'.format(exe_shell_ivi_ui.full_path())
+endif
diff --git a/compositor/meson.build b/compositor/meson.build
new file mode 100644
index 0000000..6d74269
--- /dev/null
+++ b/compositor/meson.build
@@ -0,0 +1,135 @@
+srcs_weston = [
+ git_version_h,
+ 'main.c',
+ 'text-backend.c',
+ 'weston-screenshooter.c',
+ '../shared/config-parser.c',
+ '../shared/option-parser.c',
+ '../shared/os-compatibility.c',
+ gen_text_input_server,
+ gen_text_input_impl,
+ gen_input_method_server,
+ gen_input_method_impl,
+ gen_shooter_server,
+ gen_shooter_impl,
+]
+
+deps_weston = [
+ dep_libweston,
+ dep_libinput,
+ dep_libdl,
+]
+
+if get_option('xwayland')
+ srcs_weston += 'xwayland.c'
+ config_h.set('XSERVER_PATH',
+ '"@0@"'.format(get_option('xwayland_path')))
+endif
+
+if get_option('libunwind')
+ deps_weston += dependency('libunwind')
+ config_h.set('HAVE_LIBUNWIND', '1')
+endif
+
+exe_weston = executable('weston',
+ srcs_weston,
+ include_directories:
+ include_directories('..', '../libweston', '../shared'),
+ link_args: [ '-export-dynamic' ],
+ dependencies: deps_weston,
+ install: true
+)
+install_headers('weston.h', subdir: 'weston')
+
+
+if get_option('screenshare')
+ files_screenshare = [
+ 'screen-share.c',
+ gen_fullscreen_shell_server,
+ gen_fullscreen_shell_client,
+ gen_fullscreen_shell_impl,
+ ]
+
+ deps_screenshare = [
+ dep_libweston,
+ dep_wayland_client,
+ ]
+
+ plugin_screenshare = shared_library('screen-share',
+ files_screenshare,
+ include_directories:
+ include_directories('..', '../libweston', '../shared'),
+ dependencies: deps_screenshare,
+ name_prefix: '',
+ install: true,
+ install_dir: dir_weston_module,
+ )
+ env_modmap += 'screen-share.so=@0@;'.format(plugin_screenshare.full_path())
+endif
+
+if get_option('color_management_lcms')
+ config_h.set('HAVE_LCMS', '1')
+
+ files_lcms = [
+ 'cms-static.c',
+ 'cms-helper.c',
+ ]
+
+ deps_lcms = [
+ dep_libweston,
+ dependency('lcms2'),
+ ]
+
+ plugin_lcms = shared_library('cms-static',
+ files_lcms,
+ include_directories:
+ include_directories('..', '../libweston', '../shared'),
+ dependencies: deps_lcms,
+ name_prefix: '',
+ install: true,
+ install_dir: dir_weston_module,
+ )
+ env_modmap += 'cms-static.so=@0@;'.format(plugin_lcms.full_path())
+endif
+
+if get_option('color_management_colord')
+ if not get_option('color_management_lcms')
+ error('LCMS must be enabled to support colord')
+ endif
+
+ files_colord = [
+ 'cms-colord.c',
+ 'cms-helper.c',
+ ]
+
+ deps_colord = [
+ dep_libweston,
+ dependency('colord', version: '>= 0.1.27')
+ ]
+
+ plugin_colord = shared_library('cms-colord',
+ files_colord,
+ include_directories:
+ include_directories('..', '../libweston', '../shared'),
+ dependencies: deps_colord,
+ name_prefix: '',
+ install: true,
+ install_dir: dir_weston_module,
+ )
+ env_modmap += 'cms-colord.so=@0@;'.format(plugin_colord.full_path())
+endif
+
+
+weston_ini_config = configuration_data()
+weston_ini_config.set('bindir',
+ '@0@/@1@'.format(get_option('prefix'), get_option('bindir')))
+weston_ini_config.set('libexecdir',
+ '@0@/@1@'.format(get_option('prefix'), get_option('libexecdir')))
+weston_ini_config.set('abs_top_srcdir', meson.source_root())
+weston_ini_config.set('abs_top_builddir', meson.build_root())
+configure_file(input: '../weston.ini.in',
+ output: 'weston.ini',
+ install: true,
+ install_dir: '@0@/xdg/weston'.format(get_option('sysconfdir')),
+ configuration: weston_ini_config,
+)
diff --git a/desktop-shell/meson.build b/desktop-shell/meson.build
new file mode 100644
index 0000000..d244dd4
--- /dev/null
+++ b/desktop-shell/meson.build
@@ -0,0 +1,31 @@
+if get_option('shell_desktop')
+ config_h.set('WESTON_SHELL_CLIENT', '"weston-desktop-shell"')
+
+ files_shell_desktop = [
+ 'shell.c',
+ 'exposay.c',
+ 'input-panel.c',
+ '../shared/matrix.c',
+ '../shared/config-parser.c',
+ gen_desktop_shell_server,
+ gen_desktop_shell_impl,
+ gen_input_method_server,
+ gen_input_method_impl,
+ ]
+
+ deps_shell_desktop = [
+ dep_lib_desktop,
+ dep_libweston,
+ ]
+
+ plugin_shell_desktop = shared_library('desktop-shell',
+ files_shell_desktop,
+ include_directories:
+ include_directories('..', '../libweston', '../shared'),
+ dependencies: deps_shell_desktop,
+ name_prefix: '',
+ install: true,
+ install_dir: dir_weston_module,
+ )
+ env_modmap += 'desktop-shell.so=@0@;'.format(plugin_shell_desktop.full_path())
+endif
diff --git a/fullscreen-shell/meson.build b/fullscreen-shell/meson.build
new file mode 100644
index 0000000..393d7ce
--- /dev/null
+++ b/fullscreen-shell/meson.build
@@ -0,0 +1,18 @@
+if get_option('shell_fullscreen')
+ files_shell_fullscreen = [
+ 'fullscreen-shell.c',
+ '../shared/matrix.c',
+ gen_fullscreen_shell_server,
+ gen_fullscreen_shell_impl,
+ ]
+
+ shared_library('fullscreen-shell',
+ files_shell_fullscreen,
+ include_directories:
+ include_directories('..', '../libweston', '../shared'),
+ dependencies: dep_libweston,
+ name_prefix: '',
+ install: true,
+ install_dir: dir_weston_module,
+ )
+endif
diff --git a/ivi-shell/meson.build b/ivi-shell/meson.build
new file mode 100644
index 0000000..5eb634c
--- /dev/null
+++ b/ivi-shell/meson.build
@@ -0,0 +1,61 @@
+if get_option('shell_ivi')
+ files_shell_ivi = [
+ 'ivi-shell.c',
+ 'ivi-layout.c',
+ 'ivi-layout-transition.c',
+ 'input-panel-ivi.c',
+ '../shared/matrix.c',
+ '../shared/option-parser.c',
+ gen_ivi_application_server,
+ gen_ivi_application_impl,
+ gen_input_method_server,
+ gen_input_method_impl,
+ ]
+
+ plugin_shell_ivi = shared_library('ivi-shell',
+ files_shell_ivi,
+ include_directories:
+ include_directories('..', '../libweston', '../shared'),
+ dependencies: dep_libweston,
+ name_prefix: '',
+ install: true,
+ install_dir: dir_weston_module,
+ )
+ env_modmap += 'ivi-shell.so=@0@;'.format(plugin_shell_ivi.full_path())
+
+ install_headers('ivi-layout-export.h', subdir: 'weston')
+
+ files_ivi_hmi = [
+ 'hmi-controller.c',
+ '../shared/config-parser.c',
+ '../shared/xalloc.c',
+ gen_ivi_hmi_server,
+ gen_ivi_hmi_impl,
+ ]
+
+ plugin_ivi_hmi = shared_library('hmi-controller',
+ files_ivi_hmi,
+ include_directories:
+ include_directories('..', '../libweston', '../shared'),
+ dependencies: dep_libweston,
+ name_prefix: '',
+ install: true,
+ install_dir: dir_weston_module,
+ )
+ env_modmap += 'hmi-controller.so=@0@;'.format(plugin_ivi_hmi.full_path())
+
+ ivi_test_config = configuration_data()
+ ivi_test_config.set('bindir',
+ '@0@/@1@'.format(get_option('prefix'), get_option('bindir')))
+ ivi_test_config.set('libexecdir',
+ '@0@/@1@'.format(get_option('prefix'),
+ get_option('libexecdir')))
+ ivi_test_config.set('abs_top_srcdir', meson.current_source_dir())
+ ivi_test_config.set('abs_top_builddir', meson.current_build_dir())
+ ivi_test_config.set('plugin_prefix', meson.current_build_dir())
+ ivi_test_ini = configure_file(input: '../ivi-shell/weston.ini.in',
+ output: 'weston-ivi-test.ini',
+ install: false,
+ configuration: weston_ini_config,
+ )
+endif
diff --git a/libweston-desktop/meson.build b/libweston-desktop/meson.build
new file mode 100644
index 0000000..e640ad8
--- /dev/null
+++ b/libweston-desktop/meson.build
@@ -0,0 +1,44 @@
+srcs_libdesktop = [
+ 'libweston-desktop.c',
+ 'client.c',
+ 'seat.c',
+ 'surface.c',
+ 'xwayland.c',
+ 'wl-shell.c',
+ 'xdg-shell-v5.c',
+ 'xdg-shell-v6.c',
+ gen_xdg_shell5_server,
+ gen_xdg_shell5_impl,
+ gen_xdg_shell6_server,
+ gen_xdg_shell6_impl,
+]
+lib_desktop = shared_library('weston-desktop- at 0@'.format(libweston_major),
+ srcs_libdesktop,
+ include_directories:
+ include_directories('..', '../libweston', '../shared'),
+ install: true,
+ version: '0.0.0',
+ dependencies: dep_libweston,
+)
+dep_lib_desktop = declare_dependency(
+ link_with: lib_desktop,
+ dependencies: dep_libweston,
+)
+install_headers('libweston-desktop.h',
+ subdir: 'libweston- at 0@'.format(libweston_major)
+)
+
+pkgconfig.generate(
+ filebase: 'libweston-desktop- at 0@'.format(libweston_major),
+ name: 'libweston-desktop',
+ description: 'Desktop shells abstraction library for libweston compositors',
+ version: '@0 at .0.0'.format(libweston_major),
+ libraries: lib_desktop,
+ subdirs: [
+ 'libweston- at 0@'.format(libweston_major),
+ ],
+ requires_private: [
+ 'libweston- at 0@'.format(libweston_major),
+ 'wayland-server'
+ ],
+)
diff --git a/libweston/git-version.h.meson b/libweston/git-version.h.meson
new file mode 100644
index 0000000..d91f19c
--- /dev/null
+++ b/libweston/git-version.h.meson
@@ -0,0 +1 @@
+#define BUILD_ID "@VCS_TAG@"
diff --git a/libweston/meson.build b/libweston/meson.build
new file mode 100644
index 0000000..aa19555
--- /dev/null
+++ b/libweston/meson.build
@@ -0,0 +1,369 @@
+deps_libweston = [
+ dep_wayland_server,
+ dep_pixman,
+ dep_libm,
+ dep_libdl,
+]
+srcs_libweston = [
+ git_version_h,
+ 'compositor.c',
+ 'plugin-registry.c',
+ 'input.c',
+ 'bindings.c',
+ 'log.c',
+ 'timeline.c',
+ 'data-device.c',
+ 'clipboard.c',
+ 'animation.c',
+ 'zoom.c',
+ 'noop-renderer.c',
+ 'pixman-renderer.c',
+ 'linux-dmabuf.c',
+ 'screenshooter.c',
+ '../shared/file-util.c',
+ '../shared/matrix.c',
+ '../shared/os-compatibility.c',
+ gen_dmabuf_server,
+ gen_dmabuf_impl,
+ gen_text_cursor_pos_server,
+ gen_text_cursor_pos_impl,
+ gen_text_input_server,
+ gen_text_input_impl,
+ gen_input_method_server,
+ gen_input_method_impl,
+ gen_presentation_time_server,
+ gen_presentation_time_impl,
+ gen_viewporter_impl,
+ gen_viewporter_server,
+ gen_rel_ptr_server,
+ gen_rel_ptr_impl,
+ gen_ptr_constraints_server,
+ gen_ptr_constraints_impl,
+ gen_shooter_server,
+ gen_shooter_impl,
+]
+
+install_headers(
+ 'compositor.h',
+ 'windowed-output-api.h',
+ 'plugin-registry.h',
+ 'timeline-object.h',
+ '../shared/matrix.h',
+ '../shared/config-parser.h',
+ '../shared/zalloc.h',
+ subdir: 'libweston- at 0@'.format(libweston_major)
+)
+
+if get_option('xkbcommon')
+ deps_libweston += dep_xkbcommon
+endif
+
+lib_weston = shared_library('weston- at 0@'.format(libweston_major),
+ srcs_libweston,
+ include_directories: include_directories('..', '../shared'),
+ link_args: [ '-export-dynamic' ],
+ install: true,
+ version: '0.0.0',
+ dependencies: deps_libweston,
+)
+dep_libweston = declare_dependency(
+ link_with: lib_weston,
+ dependencies: deps_libweston
+)
+
+pkgconfig.generate(
+ filebase: 'libweston- at 0@'.format(libweston_major),
+ name: 'libweston API',
+ description: 'Header files for libweston compositors development',
+ version: '@0 at .0.0'.format(libweston_major),
+ subdirs: [
+ 'libweston- at 0@'.format(libweston_major)
+ ],
+ requires_private: [
+ 'wayland-server',
+ 'pixman-1',
+ 'xkbcommon',
+ ],
+)
+
+
+srcs_session_helper = [
+ 'launcher-util.c',
+ 'launcher-weston-launch.c',
+ 'launcher-direct.c',
+]
+deps_session_helper = [
+ dep_libweston,
+]
+
+if get_option('backend_drm')
+ dep_drm = dependency('libdrm', version: '>= 2.4.30')
+ deps_session_helper += dep_drm
+ config_h.set('HAVE_LIBDRM', '1')
+endif
+
+if get_option('launcher_logind')
+ systemd_dep = dependency('libsystemd', version: '>= 209', optional: 'true')
+ if systemd_dep.found()
+ config_h.set('HAVE_SYSTEMD_LOGIN_209', '1')
+ else
+ systemd_dep = dependency('libsystemd-login', version: '>= 198')
+ endif
+ config_h.set('HAVE_DBUS', '1')
+ config_h.set('HAVE_SYSTEMD_LOGIN', '1')
+
+ srcs_session_helper += [
+ 'dbus.c',
+ 'launcher-logind.c',
+ ]
+ deps_session_helper += [
+ dependency('dbus-1', version: '>= 1.6'),
+ systemd_dep,
+ ]
+endif
+
+lib_session_helper = static_library('session-helper',
+ srcs_session_helper,
+ include_directories: include_directories('..', '../shared'),
+ dependencies: deps_session_helper,
+ install: false,
+)
+dep_session_helper = declare_dependency(link_with: lib_session_helper)
+
+
+if get_option('backend_drm')
+ files_drm = [
+ 'compositor-drm.c',
+ 'libbacklight.c',
+ 'libinput-seat.c',
+ 'libinput-device.c',
+ gen_presentation_time_server,
+ ]
+
+ deps_drm = [
+ dep_libweston,
+ dep_session_helper,
+ dep_drm,
+ dep_libinput,
+ dependency('libudev', version: '>= 136'),
+ dependency('mtdev', version: '>= 1.1.0')
+ ]
+
+ if get_option('renderer_gl')
+ deps_drm += dependency('gbm')
+ endif
+
+ if get_option('backend_drm_screencast_vaapi')
+ files_drm += 'vaapi-recorder.c'
+ deps_drm += [
+ dependency('libva', version: '>= 0.34.0'),
+ dependency('libva-drm', version: '>= 0.34.0'),
+ dependency('threads'),
+ ]
+ config_h.set('BUILD_VAAPI_RECORDER', '1')
+ endif
+
+ if dep_drm.version().version_compare('>= 2.4.64')
+ config_h.set('HAVE_DRM_ATOMIC', '1')
+ endif
+
+ if dep_drm.version().version_compare('>= 2.4.71')
+ config_h.set('HAVE_DRM_ADDFB2_MODIFIERS', '1')
+ endif
+
+ plugin_drm = shared_library('drm-backend',
+ files_drm,
+ include_directories: include_directories('..', '../shared'),
+ dependencies: deps_drm,
+ name_prefix: '',
+ install: true,
+ install_dir: dir_libweston_module,
+ )
+ env_modmap += 'drm-backend.so=@0@;'.format(plugin_drm.full_path())
+
+ install_headers('compositor-drm.h',
+ subdir: 'libweston- at 0@'.format(libweston_major)
+ )
+endif
+
+
+if get_option('backend_fbdev')
+ files_fbdev = [
+ 'compositor-fbdev.c',
+ gen_presentation_time_server,
+ ]
+
+ plugin_fbdev = shared_library('fbdev-backend',
+ files_fbdev,
+ include_directories: include_directories('..', '../shared'),
+ dependencies: dep_libweston,
+ name_prefix: '',
+ install: true,
+ install_dir: dir_libweston_module,
+ )
+ env_modmap += 'fbdev-backend.so=@0@;'.format(plugin_fbdev.full_path())
+
+ install_headers('compositor-fbdev.h',
+ subdir: 'libweston- at 0@'.format(libweston_major)
+ )
+endif
+
+
+if get_option('backend_headless')
+ files_headless = [
+ 'compositor-headless.c',
+ gen_presentation_time_server,
+ ]
+
+ plugin_headless = shared_library('headless-backend',
+ files_headless,
+ include_directories: include_directories('..', '../shared'),
+ dependencies: dep_libweston,
+ name_prefix: '',
+ install: true,
+ install_dir: dir_libweston_module,
+ )
+ env_modmap += 'headless-backend.so=@0@;'.format(plugin_headless.full_path())
+
+ install_headers('compositor-headless.h',
+ subdir: 'libweston- at 0@'.format(libweston_major)
+ )
+endif
+
+
+if get_option('backend_rdp')
+ dep_frdp = dependency('freerdp2', version: '>= 2.0.0', optional: true)
+ if not dep_frdp.found()
+ dep_frdp = dependency('freerdp', version: '>= 1.1.0')
+ endif
+
+ deps_rdp = [
+ dep_libweston,
+ dep_frdp,
+ ]
+ plugin_rdp = shared_library('rdp-backend',
+ 'compositor-rdp.c',
+ include_directories: include_directories('..', '../shared'),
+ dependencies: deps_rdp,
+ name_prefix: '',
+ install: true,
+ install_dir: dir_libweston_module,
+ )
+ env_modmap += 'rdp-backend.so=@0@;'.format(plugin_rdp.full_path())
+
+ install_headers('compositor-rdp.h',
+ subdir: 'libweston- at 0@'.format(libweston_major)
+ )
+endif
+
+
+if get_option('backend_wayland')
+ files_wlwl = [
+ 'compositor-wayland.c',
+ '../shared/os-compatibility.c',
+ gen_fullscreen_shell_impl,
+ gen_fullscreen_shell_client,
+ gen_xdg_shell5_client,
+ gen_xdg_shell5_impl,
+ gen_xdg_shell6_client,
+ gen_xdg_shell6_impl,
+ gen_presentation_time_server,
+ gen_presentation_time_impl,
+ ]
+
+ deps_wlwl = [
+ dependency('wayland-client'),
+ dependency('wayland-cursor'),
+ dep_pixman,
+ dep_libweston,
+ dep_lib_cairo_shared,
+ ]
+
+ if get_option('renderer_gl')
+ deps_wlwl += dependency('wayland-egl')
+ endif
+
+ plugin_wlwl = shared_library('wayland-backend',
+ files_wlwl,
+ include_directories: include_directories('..', '../shared'),
+ dependencies: deps_wlwl,
+ name_prefix: '',
+ install: true,
+ install_dir: dir_libweston_module,
+ )
+ env_modmap += 'wayland-backend.so=@0@;'.format(plugin_wlwl.full_path())
+
+ install_headers('compositor-wayland.h',
+ subdir: 'libweston- at 0@'.format(libweston_major)
+ )
+endif
+
+
+if get_option('backend_x11')
+ files_x11 = [
+ 'compositor-x11.c',
+ gen_presentation_time_server,
+ ]
+
+ deps_x11 = [
+ dependency('xcb', version: '>= 1.8'),
+ dependency('xcb-shm'),
+ dependency('x11'),
+ dependency('x11-xcb'),
+ dep_pixman,
+ ]
+
+ dep_xcb_xkb = dependency('xcb-xkb', version: '>= 1.9', optional: true)
+ if dep_xcb_xkb.found()
+ deps_x11 += dep_xcb_xkb
+ config_h.set('HAVE_XCB_XKB', '1')
+ endif
+
+ if get_option('renderer_gl')
+ deps_x11 += dependency('egl')
+ endif
+
+ plugin_x11 = shared_library('x11-backend',
+ files_x11,
+ include_directories: include_directories('..', '../shared'),
+ dependencies: deps_x11,
+ name_prefix: '',
+ install: true,
+ install_dir: dir_libweston_module,
+ )
+ env_modmap += 'x11-backend.so=@0@;'.format(plugin_x11.full_path())
+
+ install_headers('compositor-x11.h',
+ subdir: 'libweston- at 0@'.format(libweston_major)
+ )
+endif
+
+
+if get_option('renderer_gl')
+ config_h.set('ENABLE_EGL', '1')
+
+ files_renderer_gl = [
+ 'gl-renderer.c',
+ 'vertex-clipping.c',
+ '../shared/matrix.c',
+ gen_dmabuf_server,
+ gen_dmabuf_impl,
+ ]
+
+ deps_renderer_gl = [
+ dependency('egl'),
+ dependency('glesv2'),
+ dep_pixman,
+ dep_libweston,
+ ]
+
+ plugin_gl = shared_library('gl-renderer',
+ files_renderer_gl,
+ include_directories: include_directories('..', '../shared'),
+ dependencies: deps_renderer_gl,
+ name_prefix: '',
+ install: true,
+ install_dir: dir_libweston_module,
+ )
+ env_modmap += 'gl-renderer.so=@0@;'.format(plugin_gl.full_path())
+endif
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..d35f49c
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,114 @@
+project('weston',
+ 'c',
+ version: '1.12.90',
+ default_options: [
+ 'warning_level=2',
+ 'c_std=gnu99',
+ 'b_lundef=false',
+ ],
+ meson_version: '>= 0.36',
+ license: 'MIT/Expat',
+)
+
+pkgconfig = import('pkgconfig')
+
+libweston_major = 2
+weston_version = meson.project_version()
+version_arr = weston_version.split('.')
+libweston_version_h = configuration_data()
+libweston_version_h.set('WESTON_VERSION_MAJOR', version_arr.get(0))
+libweston_version_h.set('WESTON_VERSION_MINOR', version_arr.get(1))
+libweston_version_h.set('WESTON_VERSION_MICRO', version_arr.get(2))
+libweston_version_h.set('WESTON_VERSION', weston_version)
+version_h = configure_file(
+ input: 'libweston/version.h.in',
+ output: 'version.h',
+ configuration: libweston_version_h,
+ install_dir: '@0@/libweston'.format(get_option('includedir'))
+)
+git_version_h = vcs_tag(
+ input: 'libweston/git-version.h.meson',
+ output: 'git-version.h',
+ fallback: weston_version,
+ install: false
+)
+
+config_h = configuration_data()
+
+cc = meson.get_compiler('c')
+
+add_global_arguments([
+ '-Wno-unused-parameter',
+ '-Wno-shift-negative-value', # required due to Pixman
+ '-Wno-missing-field-initializers',
+ '-fvisibility=hidden',
+ '-DIN_WESTON',
+], language: 'c')
+
+env_modmap = ''
+
+dir_weston_module = '@0@/weston'.format(get_option('libdir'))
+dir_libweston_module = '@0@/libweston- at 1@'.format(get_option('libdir'), libweston_major)
+
+config_h.set('_GNU_SOURCE', '1')
+
+config_h.set('PACKAGE_STRING', '"weston @0@"'.format(weston_version))
+config_h.set('PACKAGE_VERSION', '"@0@"'.format(weston_version))
+config_h.set('VERSION', '"@0@"'.format(weston_version))
+config_h.set('PACKAGE_URL', '"https://wayland.freedesktop.org"')
+config_h.set('PACKAGE_BUGREPORT',
+ '"https://bugs.freedesktop.org/enter_bug.cgi?product=Wayland&component=weston"')
+
+config_h.set('BINDIR',
+ '"@0@/@1@"'.format(get_option('prefix'), get_option('bindir')))
+config_h.set('DATADIR',
+ '"@0@/@1@"'.format(get_option('prefix'), get_option('datadir')))
+config_h.set('LIBEXECDIR',
+ '"@0@/@1@"'.format(get_option('prefix'), get_option('libexecdir')))
+config_h.set('MODULEDIR',
+ '"@0@/@1@"'.format(get_option('prefix'), dir_weston_module))
+config_h.set('LIBWESTON_MODULEDIR',
+ '"@0@/@1@"'.format(get_option('prefix'), dir_libweston_module))
+
+opt_backend_native = get_option('backend_default')
+if opt_backend_native == ''
+ if get_option('backend_drm')
+ opt_backend_native = 'drm-backend.so'
+ elif get_option('backend_wayland')
+ opt_backend_native = 'wayland-backend.so'
+ elif get_option('backend_x11')
+ opt_backend_native = 'x11-backend.so'
+ elif get_option('backend_headless')
+ opt_backend_native = 'headless-backend.so'
+ endif
+endif
+config_h.set('WESTON_NATIVE_BACKEND', '"@0@"'.format(opt_backend_native))
+
+if get_option('xkbcommon')
+ dep_xkbcommon = dependency('xkbcommon', version: '>= 0.3.0')
+ config_h.set('ENABLE_XKBCOMMON', '1')
+ if dep_xkbcommon.version().version_compare('>= 0.5.0')
+ config_h.set('HAVE_XKBCOMMON_COMPOSE', '1')
+ endif
+endif
+
+dep_wayland_server = dependency('wayland-server', version: '>= 1.12.0')
+dep_wayland_client = dependency('wayland-client', version: '>= 1.12.0')
+dep_pixman = dependency('pixman-1', version: '>= 0.25.2')
+dep_libinput = dependency('libinput', version: '>= 0.8.0')
+dep_libm = cc.find_library('m')
+dep_libdl = cc.find_library('dl')
+
+subdir('protocol')
+subdir('shared')
+subdir('libweston')
+subdir('libweston-desktop')
+subdir('xwayland')
+subdir('compositor')
+subdir('desktop-shell')
+subdir('fullscreen-shell')
+subdir('ivi-shell')
+subdir('clients')
+subdir('tests')
+
+configure_file(output: 'config.h', install: false, configuration: config_h)
diff --git a/meson_options.txt b/meson_options.txt
new file mode 100644
index 0000000..5c486df
--- /dev/null
+++ b/meson_options.txt
@@ -0,0 +1,126 @@
+option('backend_drm',
+ type: 'boolean',
+ default: true,
+ description: 'Weston backend: DRM/KMS')
+option('backend_drm_screencast_vaapi',
+ type: 'boolean',
+ default: true,
+ description: 'DRM/KMS backend support for VA-API screencasting')
+option('backend_fbdev',
+ type: 'boolean',
+ default: true,
+ description: 'Weston backend: fbdev (legacy)')
+option('backend_headless',
+ type: 'boolean',
+ default: true,
+ description: 'Weston backend: headless (testing)')
+option('backend_rdp',
+ type: 'boolean',
+ default: true,
+ description: 'Weston backend: RDP remote screensharing')
+option('screenshare',
+ type: 'boolean',
+ default: true,
+ description: 'Compositor: RDP screen-sharing support')
+option('backend_wayland',
+ type: 'boolean',
+ default: true,
+ description: 'Weston backend: Wayland (nested)')
+option('backend_x11',
+ type: 'boolean',
+ default: true,
+ description: 'Weston backend: X11 (nested)')
+option('backend_default',
+ type: 'string',
+ default: '',
+ description: 'Weston backend: default backend selection')
+
+option('renderer_gl',
+ type: 'boolean',
+ default: true,
+ description: 'Weston renderer: EGL / OpenGL ES 2.x')
+option('renderer_pixman',
+ type: 'boolean',
+ default: true,
+ description: 'Weston renderer: Pixman (software rendering)')
+
+option('xwayland',
+ type: 'boolean',
+ default: true,
+ description: 'Xwayland: support for X11 clients inside Weston')
+option('xwayland_path',
+ type: 'string',
+ value: '/usr/bin/Xwayland',
+ description: 'Xwayland: path to installed Xwayland binary')
+
+option('shell_desktop',
+ type: 'boolean',
+ default: true,
+ description: 'Weston shell UI: traditional desktop')
+option('shell_fullscreen',
+ type: 'boolean',
+ default: true,
+ description: 'Weston shell UI: fullscreen/kiosk')
+option('shell_ivi',
+ type: 'boolean',
+ default: true,
+ description: 'Weston shell UI: IVI (automotive)')
+
+option('color_management_lcms',
+ type: 'boolean',
+ default: true,
+ description: 'Compositor color management: lcms')
+option('color_management_colord',
+ type: 'boolean',
+ default: true,
+ description: 'Compositor color management: colord (requires lcms)')
+
+option('launcher_logind',
+ type: 'boolean',
+ default: true,
+ description: 'Compositor: support systemd-logind D-Bus protocol')
+
+option('xkbcommon',
+ type: 'boolean',
+ default: true,
+ description: 'Input: use libxkbcommon for keyboard handling')
+
+option('libunwind',
+ type: 'boolean',
+ default: true,
+ description: 'Compositor: use libunwind for crash backtraces')
+
+option('image_jpeg',
+ type: 'boolean',
+ default: true,
+ description: 'Compositor: JPEG screenshot support')
+option('image_webp',
+ type: 'boolean',
+ default: true,
+ description: 'Compositor: screensharing video support with WebP')
+
+option('clients_simple',
+ type: 'boolean',
+ default: true,
+ description: 'Sample clients: simple demo programs')
+option('clients_suite',
+ type: 'boolean',
+ default: true,
+ description: 'Sample clients: extended suite of demo programs')
+option('clients_egl',
+ type: 'boolean',
+ default: true,
+ description: 'Sample clients: EGL clients')
+option('clients_dmabuf_drm',
+ type: 'boolean',
+ default: true,
+ description: 'Sample clients: DRM-based dmabuf sample client')
+option('clients_dmabuf_v4l2',
+ type: 'boolean',
+ default: true,
+ description: 'Sample clients: V4L2/ViViD-based dmabuf sample client')
+
+option('test_junit_xml',
+ type: 'boolean',
+ default: true,
+ description: 'Tests: output JUnit XML results')
diff --git a/protocol/meson.build b/protocol/meson.build
new file mode 100644
index 0000000..97656cd
--- /dev/null
+++ b/protocol/meson.build
@@ -0,0 +1,101 @@
+# Set up and generate all our protocol stubs. It would be nice if we had some
+# more native Meson support here, to cut out some of the hideous long lines.
+
+dep_wp = dependency('wayland-protocols', version: '>= 1.7')
+dir_wp_base = dep_wp.get_pkgconfig_variable('pkgdatadir')
+
+prog_scanner = find_program('wayland-scanner')
+gen_scanner_client = generator(prog_scanner,
+ output: '@BASENAME at -client-protocol.h',
+ arguments: ['client-header', '@INPUT@', '@OUTPUT@'])
+gen_scanner_server = generator(prog_scanner,
+ output: '@BASENAME at -server-protocol.h',
+ arguments: ['server-header', '@INPUT@', '@OUTPUT@'])
+gen_scanner_impl = generator(prog_scanner,
+ output: '@BASENAME at -protocol.c',
+ arguments: ['code', '@INPUT@', '@OUTPUT@'])
+
+proto_text_cursor = 'text-cursor-position.xml'
+gen_text_cursor_pos_server = gen_scanner_server.process(proto_text_cursor)
+gen_text_cursor_pos_client = gen_scanner_client.process(proto_text_cursor)
+gen_text_cursor_pos_impl = gen_scanner_impl.process(proto_text_cursor)
+
+proto_text_input = '@0@/unstable/text-input/text-input-unstable-v1.xml'.format(dir_wp_base)
+gen_text_input_server = gen_scanner_server.process(proto_text_input)
+gen_text_input_client = gen_scanner_client.process(proto_text_input)
+gen_text_input_impl = gen_scanner_impl.process(proto_text_input)
+
+proto_input_method = '@0@/unstable/input-method/input-method-unstable-v1.xml'.format(dir_wp_base)
+gen_input_method_server = gen_scanner_server.process(proto_input_method)
+gen_input_method_client = gen_scanner_client.process(proto_input_method)
+gen_input_method_impl = gen_scanner_impl.process(proto_input_method)
+
+proto_rel_ptr = '@0@/unstable/relative-pointer/relative-pointer-unstable-v1.xml'.format(dir_wp_base)
+gen_rel_ptr_server = gen_scanner_server.process(proto_rel_ptr)
+gen_rel_ptr_client = gen_scanner_client.process(proto_rel_ptr)
+gen_rel_ptr_impl = gen_scanner_impl.process(proto_rel_ptr)
+
+proto_ptr_constraints = '@0@/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml'.format(dir_wp_base)
+gen_ptr_constraints_client = gen_scanner_client.process(proto_ptr_constraints)
+gen_ptr_constraints_server = gen_scanner_server.process(proto_ptr_constraints)
+gen_ptr_constraints_impl = gen_scanner_impl.process(proto_ptr_constraints)
+
+
+proto_dmabuf = '@0@/unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml'.format(dir_wp_base)
+gen_dmabuf_server = gen_scanner_server.process(proto_dmabuf)
+gen_dmabuf_client = gen_scanner_client.process(proto_dmabuf)
+gen_dmabuf_impl = gen_scanner_impl.process(proto_dmabuf)
+
+proto_viewporter = '@0@/stable/viewporter/viewporter.xml'.format(dir_wp_base)
+gen_viewporter_client = gen_scanner_client.process(proto_viewporter)
+gen_viewporter_server = gen_scanner_server.process(proto_viewporter)
+gen_viewporter_impl = gen_scanner_impl.process(proto_viewporter)
+
+proto_presentation_time = '@0@/stable/presentation-time/presentation-time.xml'.format(dir_wp_base)
+gen_presentation_time_server = gen_scanner_server.process(proto_presentation_time)
+gen_presentation_time_client = gen_scanner_client.process(proto_presentation_time)
+gen_presentation_time_impl = gen_scanner_impl.process(proto_presentation_time)
+
+proto_xdg5 = '@0@/unstable/xdg-shell/xdg-shell-unstable-v5.xml'.format(dir_wp_base)
+gen_xdg_shell5_client = gen_scanner_client.process(proto_xdg5)
+gen_xdg_shell5_server = gen_scanner_server.process(proto_xdg5)
+gen_xdg_shell5_impl = gen_scanner_impl.process(proto_xdg5)
+
+proto_xdg6 = '@0@/unstable/xdg-shell/xdg-shell-unstable-v6.xml'.format(dir_wp_base)
+gen_xdg_shell6_client = gen_scanner_client.process(proto_xdg6)
+gen_xdg_shell6_server = gen_scanner_server.process(proto_xdg6)
+gen_xdg_shell6_impl = gen_scanner_impl.process(proto_xdg6)
+
+
+proto_desktop_shell = 'weston-desktop-shell.xml'
+gen_desktop_shell_server = gen_scanner_server.process(proto_desktop_shell)
+gen_desktop_shell_client = gen_scanner_client.process(proto_desktop_shell)
+gen_desktop_shell_impl = gen_scanner_impl.process(proto_desktop_shell)
+
+proto_shooter = 'weston-screenshooter.xml'
+gen_shooter_server = gen_scanner_server.process(proto_shooter)
+gen_shooter_client = gen_scanner_client.process(proto_shooter)
+gen_shooter_impl = gen_scanner_impl.process(proto_shooter)
+
+
+proto_fullscreen_shell = '@0@/unstable/fullscreen-shell/fullscreen-shell-unstable-v1.xml'.format(dir_wp_base)
+gen_fullscreen_shell_server = gen_scanner_server.process(proto_fullscreen_shell)
+gen_fullscreen_shell_client = gen_scanner_client.process(proto_fullscreen_shell)
+gen_fullscreen_shell_impl = gen_scanner_impl.process(proto_fullscreen_shell)
+
+
+proto_ivi_application = 'ivi-application.xml'
+gen_ivi_application_server = gen_scanner_server.process(proto_ivi_application)
+gen_ivi_application_client = gen_scanner_client.process(proto_ivi_application)
+gen_ivi_application_impl = gen_scanner_impl.process(proto_ivi_application)
+
+proto_ivi_hmi = 'ivi-hmi-controller.xml'
+gen_ivi_hmi_server = gen_scanner_server.process(proto_ivi_hmi)
+gen_ivi_hmi_client = gen_scanner_client.process(proto_ivi_hmi)
+gen_ivi_hmi_impl = gen_scanner_impl.process(proto_ivi_hmi)
+
+
+proto_weston_test = 'weston-test.xml'
+gen_weston_test_server = gen_scanner_server.process(proto_weston_test)
+gen_weston_test_client = gen_scanner_client.process(proto_weston_test)
+gen_weston_test_impl = gen_scanner_impl.process(proto_weston_test)
diff --git a/shared/meson.build b/shared/meson.build
new file mode 100644
index 0000000..efb1076
--- /dev/null
+++ b/shared/meson.build
@@ -0,0 +1,33 @@
+srcs_cairo_shared = [
+ 'cairo-util.c',
+ 'frame.c',
+ 'image-loader.c',
+]
+
+deps_cairo_shared = [
+ dependency('cairo'),
+ dependency('libpng'),
+ dep_pixman,
+ dep_libm,
+]
+
+if get_option('image_jpeg')
+ deps_cairo_shared += cc.find_library('jpeg')
+ config_h.set('HAVE_JPEG', '1')
+endif
+
+if get_option('image_webp')
+ deps_cairo_shared += dependency('libwebp')
+ config_h.set('HAVE_WEBP', '1')
+endif
+
+lib_cairo_shared = static_library('cairo-shared',
+ srcs_cairo_shared,
+ include_directories: include_directories('..'),
+ dependencies: deps_cairo_shared,
+ install: false,
+)
+dep_lib_cairo_shared = declare_dependency(
+ link_with: lib_cairo_shared,
+ dependencies: deps_cairo_shared,
+)
diff --git a/tests/meson.build b/tests/meson.build
new file mode 100644
index 0000000..c8bb827
--- /dev/null
+++ b/tests/meson.build
@@ -0,0 +1,269 @@
+lib_test_runner = static_library('test-runner',
+ 'weston-test-runner.c',
+ include_directories: include_directories('..', '../shared'),
+ install: false,
+)
+dep_test_runner = declare_dependency(link_with: lib_test_runner)
+
+lib_test_client = static_library('test-client',
+ 'weston-test-client-helper.c',
+ '../shared/xalloc.c',
+ '../shared/os-compatibility.c',
+ gen_weston_test_client,
+ gen_weston_test_impl,
+ include_directories: include_directories('..', '../shared'),
+ dependencies: [
+ dep_wayland_client,
+ dep_pixman,
+ dependency('cairo'),
+ ],
+ install: false,
+)
+dep_test_client = declare_dependency(
+ link_with: lib_test_client,
+ dependencies: [
+ dep_test_runner,
+ dep_pixman,
+ ]
+)
+
+exe_plugin_test = shared_library('test-plugin',
+ 'weston-test.c',
+ gen_weston_test_server,
+ gen_weston_test_impl,
+ include_directories:
+ include_directories('..', '../shared', '../libweston'),
+ dependencies: [
+ dep_libweston,
+ dependency('egl'),
+ ],
+ name_prefix: '',
+ install: false,
+)
+
+# FIXME: config-parser (zuc)
+# surface-screenshot (manual)
+# matrix (manual: takes FOREVER!)
+tests_standalone = [
+ ['string'],
+ [
+ 'vertex-clip',
+ [
+ '../libweston/vertex-clipping.c'
+ ]
+ ],
+]
+
+tests_weston = [
+ ['bad-buffer'],
+ ['button'],
+ ['devices'],
+ ['event'],
+ ['keyboard'],
+ ['internal-screenshot'],
+ [
+ 'presentation',
+ [
+ gen_presentation_time_client,
+ gen_presentation_time_impl,
+ ]
+ ],
+ ['roles'],
+ ['subsurface'],
+ [
+ 'text',
+ [
+ gen_text_input_client,
+ gen_text_input_impl,
+ ]
+ ],
+ [
+ 'viewporter',
+ [
+ gen_viewporter_client,
+ gen_viewporter_impl,
+ ]
+ ],
+]
+
+if get_option('xwayland')
+ tests_weston += [ [ 'xwayland', [], dependency('x11') ] ]
+endif
+
+tests_weston_plugin = [
+ ['plugin-registry'],
+ ['surface'],
+ ['surface-global'],
+]
+
+if get_option('shell_ivi')
+ tests_weston += [
+ [
+ 'ivi-shell-app',
+ [
+ gen_ivi_application_client,
+ gen_ivi_application_impl,
+ ]
+ ]
+ ]
+ tests_weston_plugin += [
+ ['ivi-layout-internal'],
+ [
+ 'ivi-layout',
+ [
+ gen_weston_test_server,
+ gen_weston_test_impl,
+ ]
+ ],
+ ]
+
+ exe_ivi_layout_client = executable('ivi-layout-test-client',
+ 'ivi-layout-test-client.c',
+ gen_weston_test_client,
+ gen_weston_test_impl,
+ gen_ivi_application_client,
+ gen_ivi_application_impl,
+ include_directories:
+ include_directories('..', '../shared', '../libweston'),
+ dependencies: dep_test_client,
+ install: false
+ )
+
+ env_modmap += 'weston-ivi-layout-test-client=@0@;'.format(exe_ivi_layout_client.full_path())
+endif
+
+env_test_weston = [
+ 'WESTON_TEST_REFERENCE_PATH=@0@/reference'.format(meson.current_source_dir()),
+ 'WESTON_MODULE_MAP=@0@'.format(env_modmap),
+]
+
+# FIXME: the multiple loops is lame. rethink this.
+foreach t : tests_standalone
+ srcs_t = [
+ '@0 at -test.c'.format(t.get(0)),
+ gen_weston_test_client,
+ ]
+ if t.length() > 1
+ srcs_t += t.get(1)
+ endif
+
+ deps_t = [
+ dep_test_client
+ ]
+ if t.length() > 2
+ deps_t += t.get(2)
+ endif
+
+ exe_t = executable('test- at 0@'.format(t.get(0)),
+ srcs_t,
+ c_args: [ '-DUNIT_TEST' ],
+ include_directories:
+ include_directories('..', '../shared', '../libweston'),
+ dependencies: deps_t,
+ install: false,
+ )
+ test(t.get(0), exe_t)
+endforeach
+
+foreach t : tests_weston
+ srcs_t = [
+ '@0 at -test.c'.format(t.get(0)),
+ gen_weston_test_client,
+ ]
+ if t.length() > 1
+ srcs_t += t.get(1)
+ endif
+
+ deps_t = [
+ dep_test_client
+ ]
+ if t.length() > 2
+ deps_t += t.get(2)
+ endif
+
+ mods_t = '@0@'.format(exe_plugin_test.full_path())
+ if t.get(0) == 'xwayland'
+ mods_t += ',xwayland.so'
+ endif
+
+ args_t = [
+ '--backend=headless-backend.so',
+ '--socket=test- at 0@'.format(t.get(0)),
+ '--modules=@0@'.format(mods_t),
+ '--width=320',
+ '--height=240',
+ ]
+
+ # FIXME: Get this from the array ... ?
+ if t.get(0) == 'internal-screenshot'
+ args_t += [ '--config=@0@/internal-screenshot.ini'.format(meson.current_source_dir()) ]
+ args_t += [ '--use-pixman' ]
+ args_t += [ '--shell=desktop-shell.so' ]
+ elif t.get(0).startswith('ivi-')
+ args_t += [ '--config=@0@/../ivi-shell/weston-ivi-test.ini'.format(meson.current_build_dir()) ]
+ args_t += [ '--shell=ivi-shell.so' ]
+ else
+ args_t += [ '--no-config' ]
+ args_t += [ '--shell=desktop-shell.so' ]
+ endif
+
+ exe_t = executable('test- at 0@'.format(t.get(0)),
+ srcs_t,
+ c_args: [ '-DUNIT_TEST' ],
+ include_directories:
+ include_directories('..', '../shared', '../libweston'),
+ dependencies: deps_t,
+ install: false,
+ )
+
+ env_t = [
+ 'WESTON_TEST_CLIENT_PATH=@0@'.format(exe_t.full_path())
+ ]
+ env_t += env_test_weston
+
+ test(t.get(0), exe_weston, env: env_t, args: args_t)
+endforeach
+
+foreach t : tests_weston_plugin
+ srcs_t = [
+ '@0 at -test.c'.format(t.get(0)),
+ ]
+ if t.length() > 1
+ srcs_t += t.get(1)
+ endif
+
+ deps_t = [
+ dep_libweston,
+ ]
+ if t.length() > 2
+ deps_t += t.get(2)
+ endif
+
+ exe_t = shared_library('test- at 0@'.format(t.get(0)),
+ srcs_t,
+ include_directories:
+ include_directories('..', '../shared', '../libweston'),
+ dependencies: deps_t,
+ name_prefix: '',
+ install: false,
+ )
+
+ args_t = [
+ '--backend=headless-backend.so',
+ '--socket=test- at 0@'.format(t.get(0)),
+ ]
+
+ # FIXME: Get this from the array ... ?
+ if t.get(0).startswith('ivi-')
+ args_t += [ '--config=@0@/../ivi-shell/weston-ivi-test.ini'.format(meson.current_build_dir()) ]
+ args_t += [ '--modules=@0@'.format(exe_plugin_test.full_path()) ]
+ args_t += [ '--ivi-module=@0@'.format(exe_t.full_path()) ]
+ args_t += [ '--shell=ivi-shell.so' ]
+ else
+ args_t += [ '--no-config' ]
+ args_t += [ '--shell=desktop-shell.so' ]
+ args_t += [ '--modules=@0@'.format(exe_t.full_path()) ]
+ endif
+
+ test(t.get(0), exe_weston, env: env_test_weston, args: args_t)
+endforeach
diff --git a/xwayland/meson.build b/xwayland/meson.build
new file mode 100644
index 0000000..95167fc
--- /dev/null
+++ b/xwayland/meson.build
@@ -0,0 +1,34 @@
+if get_option('xwayland')
+ files_xwayland = [
+ 'launcher.c',
+ 'window-manager.c',
+ 'selection.c',
+ 'dnd.c',
+ 'hash.c',
+ ]
+
+ deps_xwayland = [
+ dependency('xcb'),
+ dependency('xcb-composite'),
+ dependency('xcb-xfixes'),
+ dependency('xcursor'),
+ dependency('cairo-xcb'),
+ dep_libweston,
+ ]
+
+ plugin_xwayland = shared_library('xwayland',
+ files_xwayland,
+ link_with: lib_cairo_shared,
+ include_directories:
+ include_directories('..', '../libweston', '../shared'),
+ dependencies: deps_xwayland,
+ name_prefix: '',
+ install: true,
+ install_dir: dir_libweston_module,
+ )
+ env_modmap += 'xwayland.so=@0@;'.format(plugin_xwayland.full_path())
+
+ install_headers('xwayland-api.h',
+ subdir: 'libweston- at 0@'.format(libweston_major)
+ )
+endif
--
2.9.3
More information about the wayland-devel
mailing list