mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2026-05-02 06:46:26 -04:00
build: Split core protocols out as separate library
Currently both libwayland-client and libwayland-server contain the core protocol symbols. This disappoints ASAN when both libraries are included in the same binary (such as in our test suite). Compositors also can include both client and server libraries, so this provides some pointless minor space savings in real world usage as well. Let's split the protocol bits off into their own library to avoid this duplication. Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
This commit is contained in:
parent
91d98b622f
commit
c8052d423a
3 changed files with 20 additions and 4 deletions
|
|
@ -11,7 +11,7 @@ wayland_cursor = library(
|
||||||
'xcursor.c',
|
'xcursor.c',
|
||||||
],
|
],
|
||||||
version: '0.0.0',
|
version: '0.0.0',
|
||||||
dependencies: [ wayland_client_dep ],
|
dependencies: [ wayland_client_dep, wayland_core_protocols_dep ],
|
||||||
c_args: [ '-DICONDIR="@0@"'.format(icondir) ],
|
c_args: [ '-DICONDIR="@0@"'.format(icondir) ],
|
||||||
install: true,
|
install: true,
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -151,12 +151,24 @@ if get_option('libraries')
|
||||||
output: 'wayland-protocol.c'
|
output: 'wayland-protocol.c'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
wayland_core_protocols = library(
|
||||||
|
'wayland-core-protocols',
|
||||||
|
sources: [
|
||||||
|
wayland_protocol_c
|
||||||
|
],
|
||||||
|
version: '0.1.0',
|
||||||
|
include_directories: root_inc,
|
||||||
|
install: true
|
||||||
|
)
|
||||||
|
wayland_core_protocols_dep = declare_dependency(
|
||||||
|
link_with: wayland_core_protocols
|
||||||
|
)
|
||||||
|
|
||||||
wayland_server = library(
|
wayland_server = library(
|
||||||
'wayland-server',
|
'wayland-server',
|
||||||
sources: [
|
sources: [
|
||||||
wayland_server_protocol_core_h,
|
wayland_server_protocol_core_h,
|
||||||
wayland_server_protocol_h,
|
wayland_server_protocol_h,
|
||||||
wayland_protocol_c,
|
|
||||||
'wayland-server.c',
|
'wayland-server.c',
|
||||||
'wayland-shm.c',
|
'wayland-shm.c',
|
||||||
'event-loop.c'
|
'event-loop.c'
|
||||||
|
|
@ -164,6 +176,7 @@ if get_option('libraries')
|
||||||
version: '0.1.0',
|
version: '0.1.0',
|
||||||
dependencies: [
|
dependencies: [
|
||||||
ffi_dep,
|
ffi_dep,
|
||||||
|
wayland_core_protocols_dep,
|
||||||
wayland_private_dep,
|
wayland_private_dep,
|
||||||
wayland_util_dep,
|
wayland_util_dep,
|
||||||
mathlib_dep,
|
mathlib_dep,
|
||||||
|
|
@ -190,6 +203,7 @@ if get_option('libraries')
|
||||||
description: 'Server side implementation of the Wayland protocol',
|
description: 'Server side implementation of the Wayland protocol',
|
||||||
version: meson.project_version(),
|
version: meson.project_version(),
|
||||||
filebase: 'wayland-server',
|
filebase: 'wayland-server',
|
||||||
|
libraries: '-lwayland-core-protocols',
|
||||||
variables: [
|
variables: [
|
||||||
'datarootdir=' + join_paths('${prefix}', get_option('datadir')),
|
'datarootdir=' + join_paths('${prefix}', get_option('datadir')),
|
||||||
'pkgdatadir=' + join_paths('${datarootdir}', meson.project_name())
|
'pkgdatadir=' + join_paths('${datarootdir}', meson.project_name())
|
||||||
|
|
@ -201,12 +215,12 @@ if get_option('libraries')
|
||||||
sources: [
|
sources: [
|
||||||
wayland_client_protocol_core_h,
|
wayland_client_protocol_core_h,
|
||||||
wayland_client_protocol_h,
|
wayland_client_protocol_h,
|
||||||
wayland_protocol_c,
|
|
||||||
'wayland-client.c'
|
'wayland-client.c'
|
||||||
],
|
],
|
||||||
version: '0.3.0',
|
version: '0.3.0',
|
||||||
dependencies: [
|
dependencies: [
|
||||||
ffi_dep,
|
ffi_dep,
|
||||||
|
wayland_core_protocols_dep,
|
||||||
wayland_private_dep,
|
wayland_private_dep,
|
||||||
wayland_util_dep,
|
wayland_util_dep,
|
||||||
mathlib_dep,
|
mathlib_dep,
|
||||||
|
|
@ -222,6 +236,7 @@ if get_option('libraries')
|
||||||
description: 'Wayland client side library',
|
description: 'Wayland client side library',
|
||||||
version: meson.project_version(),
|
version: meson.project_version(),
|
||||||
filebase: 'wayland-client',
|
filebase: 'wayland-client',
|
||||||
|
libraries: '-lwayland-core-protocols',
|
||||||
variables: [
|
variables: [
|
||||||
'datarootdir=' + join_paths('${prefix}', get_option('datadir')),
|
'datarootdir=' + join_paths('${prefix}', get_option('datadir')),
|
||||||
'pkgdatadir=' + join_paths('${datarootdir}', meson.project_name())
|
'pkgdatadir=' + join_paths('${datarootdir}', meson.project_name())
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,8 @@ test_runner_dep = declare_dependency(
|
||||||
include_directories: [ src_inc ],
|
include_directories: [ src_inc ],
|
||||||
dependencies: [
|
dependencies: [
|
||||||
dependency('threads'),
|
dependency('threads'),
|
||||||
cc.find_library('dl', required: false)
|
cc.find_library('dl', required: false),
|
||||||
|
wayland_core_protocols_dep
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue