build: make backlight a helper lib
authorPekka Paalanen <pekka.paalanen@collabora.com>
Fri, 5 Apr 2019 09:28:14 +0000 (12:28 +0300)
committerDaniel Stone <daniels@collabora.com>
Thu, 16 May 2019 12:32:34 +0000 (13:32 +0100)
Right now only used by the DRM-backend, but there is a test program that should
use this as well.

This helps with building the test program and moving DRM-backend into a
subdirectory.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
libweston/meson.build

index a7a8105e2e08e817ed31a349a0ac6728ef872d54..e3957147c3a0ca91f5b2e3d0e7455ac94a7f8418 100644 (file)
@@ -185,13 +185,27 @@ dep_libinput_backend = declare_dependency(
        include_directories: include_directories('.')
 )
 
-
 if get_option('backend-drm')
        config_h.set('BUILD_DRM_COMPOSITOR', '1')
 
+       lib_backlight = static_library(
+               'backlight',
+               'libbacklight.c',
+               dependencies: [
+                       dep_libdrm_headers,
+                       dependency('libudev')
+               ],
+               include_directories: include_directories('..'),
+               install: false,
+               build_by_default: false
+       )
+       dep_backlight = declare_dependency(
+               link_with: lib_backlight,
+               include_directories: include_directories('.')
+       )
+
        srcs_drm = [
                'compositor-drm.c',
-               'libbacklight.c',
                linux_dmabuf_unstable_v1_protocol_c,
                linux_dmabuf_unstable_v1_server_protocol_h,
                presentation_time_server_protocol_h,
@@ -203,6 +217,7 @@ if get_option('backend-drm')
                dep_libdrm,
                dep_libinput_backend,
                dependency('libudev', version: '>= 136'),
+               dep_backlight
        ]
 
        # XXX: Actually let DRM-backend build without GBM, it really should