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>
dev
Pekka Paalanen 6 years ago
parent 17389d63fd
commit 71ff95a544
  1. 11
      compositor/meson.build
  2. 2
      desktop-shell/meson.build
  3. 2
      fullscreen-shell/meson.build
  4. 4
      ivi-shell/meson.build
  5. 4
      libweston-desktop/meson.build
  6. 2
      libweston/backend-drm/meson.build
  7. 2
      libweston/backend-fbdev/meson.build
  8. 2
      libweston/backend-headless/meson.build
  9. 2
      libweston/backend-rdp/meson.build
  10. 3
      libweston/backend-wayland/meson.build
  11. 2
      libweston/backend-x11/meson.build
  12. 18
      libweston/meson.build
  13. 2
      libweston/renderer-gl/meson.build
  14. 2
      pipewire/meson.build
  15. 2
      remoting/meson.build
  16. 6
      tests/meson.build
  17. 2
      xwayland/meson.build

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Loading…
Cancel
Save