summaryrefslogtreecommitdiffhomepage
path: root/packages/ext-xdg-shell/meson.build
blob: dc0d91717662301bd46752d2b6927bcdc3ea62df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# ext-xdg-shell — window management as a core extension. Public headers (the
# contract): include/unbox/ext-xdg-shell/. Consumes the kernel ABI only.

ext_xdg_shell_inc = include_directories('include')

ext_xdg_shell_lib = static_library(
  'unbox-ext-xdg-shell',
  'src/extension.cpp',
  include_directories: ext_xdg_shell_inc,
  dependencies: [kernel_dep],
)

# What consumers (host-bin, downstream slices) link against. The kernel's
# wlroots/wayland propagation rides through kernel_dep; our public headers add
# the include path. RMLUi stays kernel-private (we contribute no UI yet).
ext_xdg_shell_dep = declare_dependency(
  link_with: ext_xdg_shell_lib,
  include_directories: ext_xdg_shell_inc,
  dependencies: [kernel_dep],
)

# Tests, asymmetric: pure policy core (doctest, no wlroots) + a headless glue
# smoke test (Server + activation probe). The test exe also compiles the glue
# source directly so it can reach the private probe factory in src/.
ext_xdg_shell_test = executable(
  'ext-xdg-shell-tests',
  'tests/test_policy.cpp',
  'tests/test_glue.cpp',
  # `src` on the path so test_glue can reach the PRIVATE probe factory
  # (src/probe.hpp) — a unit may read its own src/ (only OTHER units' src/ is
  # off-limits). policy.hpp lives there too.
  include_directories: [ext_xdg_shell_inc, include_directories('src')],
  dependencies: [ext_xdg_shell_dep, doctest_dep],
)
test('ext-xdg-shell', ext_xdg_shell_test, suite: 'ext-xdg-shell')

# slice 10 / b1: a real in-process wayland CLIENT maps an xdg_toplevel so we can
# drive the minimize MECHANISM (Toplevel::hide/show/geometry/scene_tree) on the
# wlr headless backend. Needs CLIENT-side xdg-shell bindings, generated from the
# canonical xdg-shell.xml the same way ext-layer-shell generates its protocol
# code (header + private-code-as-header, #included once by the single C++ TU).
wayland_client_dep = dependency('wayland-client')
wayland_protocols_dir = dependency('wayland-protocols').get_variable('pkgdatadir')
xdg_shell_xml = wayland_protocols_dir / 'stable' / 'xdg-shell' / 'xdg-shell.xml'

xdg_shell_client_header = custom_target(
  'xdg-shell-client-header',
  input: xdg_shell_xml,
  output: 'xdg-shell-client-protocol.h',
  command: [wayland_scanner, 'client-header', '@INPUT@', '@OUTPUT@'],
)
# private-code emitted as a .h so the C++ TU #includes it exactly once (the root
# project declares only C++; a generated .c would have no compiler).
xdg_shell_client_code = custom_target(
  'xdg-shell-client-code-impl',
  input: xdg_shell_xml,
  output: 'xdg-shell-client-protocol-code.h',
  command: [wayland_scanner, 'private-code', '@INPUT@', '@OUTPUT@'],
)

ext_xdg_shell_client_test = executable(
  'ext-xdg-shell-client-tests',
  'tests/test_minimize.cpp',
  xdg_shell_client_header,
  xdg_shell_client_code,
  dependencies: [ext_xdg_shell_dep, wayland_client_dep, doctest_dep],
)
test(
  'ext-xdg-shell-client',
  ext_xdg_shell_client_test,
  suite: 'ext-xdg-shell',
  # Real socket handshake + cooperative event-loop pump; generous timeout so a
  # slow CI box does not flake (the test fails fast on its own logic).
  timeout: 60,
)