From b40e051858728e4b44e93ef736fd204d544a80b6 Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Fri, 5 Apr 2019 12:04:58 +0300 Subject: [PATCH] build: make libinput-backend a helper lib Rather than having fbdev and drm backends include the libinput files ad hoc, wrap them in a static library. Using the dependency object for that helper library will then automatically pull in any necerray include dirs for the users. This helps with moving the backends into subdirectories. Signed-off-by: Pekka Paalanen --- libweston/meson.build | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/libweston/meson.build b/libweston/meson.build index a75182ad..a7a8105e 100644 --- a/libweston/meson.build +++ b/libweston/meson.build @@ -166,14 +166,32 @@ lib_session_helper = static_library( dep_session_helper = declare_dependency(link_with: lib_session_helper) +lib_libinput_backend = static_library( + 'libinput-backend', + [ + 'libinput-device.c', + 'libinput-seat.c' + ], + dependencies: [ + dep_libweston, + dep_libinput, + dependency('libudev', version: '>= 136') + ], + include_directories: include_directories('..'), + install: false +) +dep_libinput_backend = declare_dependency( + link_with: lib_libinput_backend, + include_directories: include_directories('.') +) + + if get_option('backend-drm') config_h.set('BUILD_DRM_COMPOSITOR', '1') srcs_drm = [ 'compositor-drm.c', 'libbacklight.c', - 'libinput-device.c', - 'libinput-seat.c', linux_dmabuf_unstable_v1_protocol_c, linux_dmabuf_unstable_v1_server_protocol_h, presentation_time_server_protocol_h, @@ -183,7 +201,7 @@ if get_option('backend-drm') dep_libweston, dep_session_helper, dep_libdrm, - dep_libinput, + dep_libinput_backend, dependency('libudev', version: '>= 136'), ] @@ -406,15 +424,13 @@ if get_option('backend-fbdev') srcs_fbdev = [ 'compositor-fbdev.c', - 'libinput-device.c', - 'libinput-seat.c', presentation_time_server_protocol_h, ] deps_fbdev = [ dep_libweston, dep_session_helper, - dep_libinput, + dep_libinput_backend, dependency('libudev', version: '>= 136'), ]