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.
This commit is contained in:
Simon Ser 2021-04-17 12:06:16 +02:00
parent f8f188a73e
commit d1328e2f4b
2 changed files with 23 additions and 38 deletions

View file

@ -61,9 +61,7 @@ add_project_arguments('-DHAVE_' + sdbus.name().to_upper() + '=1', language: 'c')
subdir('protocols') subdir('protocols')
executable( xdpw_files = files([
'xdg-desktop-portal-wlr',
files([
'src/core/main.c', 'src/core/main.c',
'src/core/logger.c', 'src/core/logger.c',
'src/core/config.c', 'src/core/config.c',
@ -76,11 +74,14 @@ executable(
'src/screencast/screencast_common.c', 'src/screencast/screencast_common.c',
'src/screencast/wlr_screencast.c', 'src/screencast/wlr_screencast.c',
'src/screencast/pipewire_screencast.c', 'src/screencast/pipewire_screencast.c',
'src/screencast/fps_limit.c' 'src/screencast/fps_limit.c',
]), ])
executable(
'xdg-desktop-portal-wlr',
[xdpw_files, wl_proto_files],
dependencies: [ dependencies: [
wayland_client, wayland_client,
wlr_protos,
sdbus, sdbus,
pipewire, pipewire,
rt, rt,

View file

@ -13,38 +13,22 @@ client_protocols = [
'xdg-output-unstable-v1.xml', 'xdg-output-unstable-v1.xml',
] ]
wl_protos_src = [] wl_proto_files = []
wl_protos_headers = []
foreach xml: client_protocols foreach xml: client_protocols
wl_protos_src += custom_target( code = custom_target(
xml.underscorify() + '_server_c', xml.underscorify() + '_c',
input: xml, input: xml,
output: '@BASENAME@-protocol.c', output: '@BASENAME@-protocol.c',
command: [wayland_scanner, 'private-code', '@INPUT@', '@OUTPUT@'], 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', xml.underscorify() + '_client_h',
input: xml, input: xml,
output: '@BASENAME@-client-protocol.h', output: '@BASENAME@-client-protocol.h',
command: [wayland_scanner, 'client-header', '@INPUT@', '@OUTPUT@'], command: [wayland_scanner, 'client-header', '@INPUT@', '@OUTPUT@'],
) )
wl_proto_files += [code, client_header]
endforeach 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,
)