From 4e952328ca117a912efb68088c8516fa1fb97b0b Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Thu, 4 Apr 2019 16:53:11 +0300 Subject: [PATCH] build: turn vertex-clipping.c into a dependency Making this into a dependency object not only carries the .c files with it, but it also brings the include directories as well, which means the users can simply use the object without guessing the paths. This should help with moving GL-renderer into a new subdirectory. Signed-off-by: Pekka Paalanen --- clients/meson.build | 4 ++-- libweston/meson.build | 6 +++++- tests/meson.build | 7 +------ 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/clients/meson.build b/clients/meson.build index 3f180f77..3d36efe4 100644 --- a/clients/meson.build +++ b/clients/meson.build @@ -226,7 +226,7 @@ demo_clients = [ { 'basename': 'clickdot' }, { 'basename': 'cliptest', - 'add_sources': [ '../libweston/vertex-clipping.c' ] + 'dep_objs': dep_vertex_clipping }, { 'basename': 'confine' }, { 'basename': 'dnd' }, @@ -277,7 +277,7 @@ if get_option('demo-clients') foreach t : demo_clients t_name = 'weston-' + t.get('basename') t_srcs = [ t.get('basename') + '.c' ] + t.get('add_sources', []) - t_deps = [ dep_toytoolkit ] + t_deps = [ dep_toytoolkit, t.get('dep_objs', []) ] foreach depname : t.get('deps', []) dep = dependency(depname, required: false) if not dep.found() diff --git a/libweston/meson.build b/libweston/meson.build index 20b7aa89..76686f22 100644 --- a/libweston/meson.build +++ b/libweston/meson.build @@ -433,6 +433,10 @@ if get_option('backend-fbdev') install_headers(backend_fbdev_h, subdir: dir_include_libweston_install) endif +dep_vertex_clipping = declare_dependency( + sources: 'vertex-clipping.c', + include_directories: include_directories('.') +) if get_option('renderer-gl') config_h.set('ENABLE_EGL', '1') @@ -440,7 +444,6 @@ if get_option('renderer-gl') srcs_renderer_gl = [ 'gl-renderer.c', 'linux-sync-file.c', - 'vertex-clipping.c', '../shared/matrix.c', linux_dmabuf_unstable_v1_protocol_c, linux_dmabuf_unstable_v1_server_protocol_h, @@ -450,6 +453,7 @@ if get_option('renderer-gl') dep_pixman, dep_libweston, dep_libdrm_headers, + dep_vertex_clipping ] foreach name : [ 'egl', 'glesv2' ] diff --git a/tests/meson.build b/tests/meson.build index b494d38d..704ab54d 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -99,12 +99,7 @@ tests_standalone = [ ['config-parser', [], [ dep_zucmain ]], ['matrix', [ '../shared/matrix.c' ], [ dep_libm, dep_libshared.partial_dependency(includes: true) ]], ['string'], - [ - 'vertex-clip', - [ - '../libweston/vertex-clipping.c' - ] - ], + [ 'vertex-clip', [], [ dep_test_client, dep_vertex_clipping ]], ['timespec', [], [ dep_zucmain ]], ['zuc', [