From d1328e2f4b7c0ff386becd54b81a77d15e9c70b9 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Sat, 17 Apr 2021 12:06:16 +0200 Subject: [PATCH] build: remove intermediate static library We don't really need to build an intermediate static library, and it's causing pain wrt. include directories and dependencies. --- meson.build | 33 +++++++++++++++++---------------- protocols/meson.build | 28 ++++++---------------------- 2 files changed, 23 insertions(+), 38 deletions(-) diff --git a/meson.build b/meson.build index 969feaa..c9865d8 100644 --- a/meson.build +++ b/meson.build @@ -61,26 +61,27 @@ add_project_arguments('-DHAVE_' + sdbus.name().to_upper() + '=1', language: 'c') subdir('protocols') +xdpw_files = files([ + 'src/core/main.c', + 'src/core/logger.c', + 'src/core/config.c', + 'src/core/request.c', + 'src/core/session.c', + 'src/core/timer.c', + 'src/core/timespec_util.c', + 'src/screenshot/screenshot.c', + 'src/screencast/screencast.c', + 'src/screencast/screencast_common.c', + 'src/screencast/wlr_screencast.c', + 'src/screencast/pipewire_screencast.c', + 'src/screencast/fps_limit.c', +]) + executable( 'xdg-desktop-portal-wlr', - files([ - 'src/core/main.c', - 'src/core/logger.c', - 'src/core/config.c', - 'src/core/request.c', - 'src/core/session.c', - 'src/core/timer.c', - 'src/core/timespec_util.c', - 'src/screenshot/screenshot.c', - 'src/screencast/screencast.c', - 'src/screencast/screencast_common.c', - 'src/screencast/wlr_screencast.c', - 'src/screencast/pipewire_screencast.c', - 'src/screencast/fps_limit.c' - ]), + [xdpw_files, wl_proto_files], dependencies: [ wayland_client, - wlr_protos, sdbus, pipewire, rt, diff --git a/protocols/meson.build b/protocols/meson.build index bdd1c65..ac5be0b 100644 --- a/protocols/meson.build +++ b/protocols/meson.build @@ -13,38 +13,22 @@ client_protocols = [ 'xdg-output-unstable-v1.xml', ] -wl_protos_src = [] -wl_protos_headers = [] +wl_proto_files = [] foreach xml: client_protocols - wl_protos_src += custom_target( - xml.underscorify() + '_server_c', + code = custom_target( + xml.underscorify() + '_c', input: xml, output: '@BASENAME@-protocol.c', command: [wayland_scanner, 'private-code', '@INPUT@', '@OUTPUT@'], ) - wl_protos_headers += custom_target( - xml.underscorify() + '_server_h', - input: xml, - output: '@BASENAME@-protocol.h', - command: [wayland_scanner, 'server-header', '@INPUT@', '@OUTPUT@'], - ) - wl_protos_headers += custom_target( + client_header = custom_target( xml.underscorify() + '_client_h', input: xml, output: '@BASENAME@-client-protocol.h', command: [wayland_scanner, 'client-header', '@INPUT@', '@OUTPUT@'], ) + + wl_proto_files += [code, client_header] endforeach - -lib_wl_protos = static_library( - 'wl_protos', - wl_protos_src + wl_protos_headers, - dependencies: wayland_client.partial_dependency(compile_args: true), -) - -wlr_protos = declare_dependency( - link_with: lib_wl_protos, - sources: wl_protos_headers, -)