build: separate deps for int and ext libweston users

We have two kinds of libweston users: internal and external. Weston, the
frontend, counts as an external user, and should not have access to libweston
private headers. The shell plugins are external users as well, because we
intend people to be able to write them. Renderers, backends, and some plugins
are internal users who will need access to private headers.

Create two different Meson dependency objects, one for each kind.

This makes it less likely to accidentally use a private header.

Screen-share is a Weston plugin and therefore counts as an external user, but
it needs the backend API to deliver input. Until we are comfortable exposing
public API for that purpose, let it use internal headers.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This commit is contained in:
Pekka Paalanen 2019-04-18 16:43:55 +03:00
parent 17389d63fd
commit 71ff95a544
17 changed files with 39 additions and 29 deletions

View File

@ -12,7 +12,7 @@ srcs_weston = [
]
deps_weston = [
dep_libshared,
dep_libweston,
dep_libweston_public,
dep_libinput,
dep_libevdev,
dep_libdl,
@ -62,7 +62,8 @@ if get_option('screenshare')
]
deps_screenshare = [
dep_libshared,
dep_libweston,
dep_libweston_public,
dep_libweston_private_h, # XXX: https://gitlab.freedesktop.org/wayland/weston/issues/292
dep_wayland_client,
]
plugin_screenshare = shared_library(
@ -94,7 +95,7 @@ if get_option('color-management-lcms')
'cms-static',
srcs_lcms,
include_directories: common_inc,
dependencies: [ dep_libweston, dep_lcms2 ],
dependencies: [ dep_libweston_public, dep_lcms2 ],
name_prefix: '',
install: true,
install_dir: dir_module_weston
@ -117,7 +118,7 @@ if get_option('color-management-colord')
error('cms-colord requires colord >= 0.1.27 which was not found. Or, you can use \'-Dcolor-management-colord=false\'.')
endif
plugin_colord_deps = [ dep_libweston, dep_colord ]
plugin_colord_deps = [ dep_libweston_public, dep_colord ]
foreach depname : [ 'glib-2.0', 'gobject-2.0' ]
dep = dependency(depname, required: false)
@ -149,7 +150,7 @@ if get_option('systemd')
'systemd-notify',
'systemd-notify.c',
include_directories: common_inc,
dependencies: [ dep_libweston, dep_libsystemd ],
dependencies: [ dep_libweston_public, dep_libsystemd ],
name_prefix: '',
install: true,
install_dir: dir_module_weston

View File

@ -13,7 +13,7 @@ if get_option('shell-desktop')
deps_shell_desktop = [
dep_libshared,
dep_lib_desktop,
dep_libweston,
dep_libweston_public,
]
plugin_shell_desktop = shared_library(
'desktop-shell',

View File

@ -8,7 +8,7 @@ if get_option('shell-fullscreen')
'fullscreen-shell',
srcs_shell_fullscreen,
include_directories: common_inc,
dependencies: dep_libweston,
dependencies: dep_libweston_public,
name_prefix: '',
install: true,
install_dir: dir_module_weston

View File

@ -12,7 +12,7 @@ if get_option('shell-ivi')
'ivi-shell',
srcs_shell_ivi,
include_directories: common_inc,
dependencies: [ dep_lib_desktop, dep_libweston ],
dependencies: [ dep_lib_desktop, dep_libweston_public ],
name_prefix: '',
install: true,
install_dir: dir_module_weston
@ -30,7 +30,7 @@ if get_option('shell-ivi')
'hmi-controller',
srcs_ivi_hmi,
include_directories: common_inc,
dependencies: [ dep_libweston, dep_libshared ],
dependencies: [ dep_libweston_public, dep_libshared ],
name_prefix: '',
install: true,
install_dir: dir_module_weston

View File

@ -18,11 +18,11 @@ lib_desktop = shared_library(
include_directories: common_inc,
install: true,
version: '0.0.@0@'.format(libweston_revision),
dependencies: dep_libweston
dependencies: dep_libweston_public
)
dep_lib_desktop = declare_dependency(
link_with: lib_desktop,
dependencies: dep_libweston
dependencies: dep_libweston_public
)
pkgconfig.generate(

View File

@ -32,7 +32,7 @@ srcs_drm = [
]
deps_drm = [
dep_libweston,
dep_libweston_private,
dep_session_helper,
dep_libdrm,
dep_libinput_backend,

View File

@ -10,7 +10,7 @@ srcs_fbdev = [
]
deps_fbdev = [
dep_libweston,
dep_libweston_private,
dep_session_helper,
dep_libinput_backend,
dependency('libudev', version: '>= 136'),

View File

@ -12,7 +12,7 @@ plugin_headless = shared_library(
'headless-backend',
srcs_headless,
include_directories: common_inc,
dependencies: dep_libweston,
dependencies: [ dep_libweston_private, dep_libdrm_headers ],
name_prefix: '',
install: true,
install_dir: dir_module_libweston,

View File

@ -22,7 +22,7 @@ if cc.has_member(
endif
deps_rdp = [
dep_libweston,
dep_libweston_private,
dep_frdp,
]
plugin_rdp = shared_library(

View File

@ -18,7 +18,8 @@ deps_wlwl = [
dependency('wayland-client'),
dependency('wayland-cursor'),
dep_pixman,
dep_libweston,
dep_libweston_private,
dep_libdrm_headers,
dep_lib_cairo_shared,
]

View File

@ -16,7 +16,7 @@ if not dep_x11_xcb.found()
endif
deps_x11 = [
dep_libweston,
dep_libweston_private,
dep_x11_xcb,
dep_lib_cairo_shared,
dep_pixman,

View File

@ -82,17 +82,25 @@ lib_weston = shared_library(
dependencies: deps_libweston
)
dep_libweston = declare_dependency(
# For external users, like Weston.
dep_libweston_public = declare_dependency(
link_with: lib_weston,
include_directories: public_inc,
dependencies: deps_libweston
)
# For internal users, like the backends.
dep_libweston_private = declare_dependency(
link_with: lib_weston,
include_directories: [ include_directories('.'), public_inc ],
dependencies: deps_libweston
)
# XXX: We should be able to use dep_libweston.partial_dependency() instead
# XXX: We should be able to use dep_libweston_private.partial_dependency() instead
# of this, but a Meson bug makes it not work. It will be fixed with
# https://github.com/mesonbuild/meson/pull/5167
# in hopefully Meson 0.51.
dep_libweston_h = declare_dependency(
dep_libweston_private_h = declare_dependency(
include_directories: [ include_directories('.'), public_inc ],
dependencies: [
dep_pixman.partial_dependency(compile_args: true),
@ -128,7 +136,7 @@ srcs_session_helper = [
'launcher-util.c',
'launcher-weston-launch.c',
]
deps_session_helper = [ dep_libweston_h ]
deps_session_helper = [ dep_libweston_private_h ]
if get_option('backend-drm')
deps_session_helper += dep_libdrm
@ -181,7 +189,7 @@ lib_libinput_backend = static_library(
'libinput-seat.c'
],
dependencies: [
dep_libweston,
dep_libweston_private,
dep_libinput,
dependency('libudev', version: '>= 136')
],

View File

@ -13,7 +13,7 @@ srcs_renderer_gl = [
deps_renderer_gl = [
dep_pixman,
dep_libweston,
dep_libweston_private,
dep_libdrm_headers,
dep_vertex_clipping
]

View File

@ -8,7 +8,7 @@ if get_option('pipewire')
depnames = [
'libpipewire-0.2', 'libspa-0.1'
]
deps_pipewire = [ dep_libweston ]
deps_pipewire = [ dep_libweston_private ]
foreach depname : depnames
dep = dependency(depname, required: false)
if not dep.found()

View File

@ -10,7 +10,7 @@ if get_option('remoting')
'gstreamer-app-1.0', 'gstreamer-video-1.0',
'gobject-2.0', 'glib-2.0'
]
deps_remoting = [ dep_libweston ]
deps_remoting = [ dep_libweston_private ]
foreach depname : depnames
dep = dependency(depname, required: false)
if not dep.found()

View File

@ -2,7 +2,7 @@ plugin_test_shell_desktop = shared_library(
'weston-test-desktop-shell',
'weston-test-desktop-shell.c',
include_directories: common_inc,
dependencies: [ dep_lib_desktop, dep_libweston ],
dependencies: [ dep_lib_desktop, dep_libweston_public ],
name_prefix: '',
install: false
)
@ -45,7 +45,7 @@ exe_plugin_test = shared_library(
weston_test_server_protocol_h,
weston_test_protocol_c,
include_directories: common_inc,
dependencies: [ dep_libweston ],
dependencies: [ dep_libweston_private ],
name_prefix: '',
install: false,
)
@ -343,7 +343,7 @@ foreach t : tests_weston_plugin
endif
deps_t = [
dep_libweston,
dep_libweston_private,
]
if t.length() > 2
deps_t += t.get(2)

View File

@ -19,7 +19,7 @@ dep_names_xwayland = [
'cairo-xcb',
]
deps_xwayland = [ dep_libweston ]
deps_xwayland = [ dep_libweston_public ]
foreach name : dep_names_xwayland
d = dependency(name, required: false)