[go: up one dir, main page]

File: meson.build

package info (click to toggle)
libdecor-0 0.2.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 492 kB
  • sloc: ansic: 8,377; cpp: 288; sh: 89; makefile: 23
file content (135 lines) | stat: -rw-r--r-- 3,064 bytes parent folder | download
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
pkg = import('pkgconfig')

libdecor_includepath = include_directories('.')

libdecor_includes = [
  libdecor_includepath,
  top_includepath,
]

libdecor_sources = [
  'libdecor.c',
  'libdecor-fallback.c',
]

libdecor_headers = [
  'libdecor.h',
]
install_headers(libdecor_headers,
  subdir: '@0@'.format(libdecor_full_name),
)

libdecor_built_sources = []

wayland_scanner = find_program('wayland-scanner')

# Format:
#  - protocol stability
#  - protocol name
#  - optional: protocol version, if unstable
wayland_protocols = [
  ['stable', 'xdg-shell'],
  ['unstable', 'xdg-decoration', '1'],
]

protocols_dir = wayland_protocols_dep.get_pkgconfig_variable('pkgdatadir')
assert(protocols_dir != '', 'Could not get pkgdatadir from wayland-protocols.pc')

foreach p: wayland_protocols
  stability = p.get(0)
  name = p.get(1)

  assert(stability in ['stable', 'unstable'],
         'protocol \'@0@\' must be \'stable\' or \'unstable\''.format(name))

  suffix = stability=='unstable' ? '-unstable-v@0@'.format(p.get(2)) : ''

  output_base = name
  input = join_paths(protocols_dir, stability, name, name+suffix+'.xml')

  libdecor_built_sources += custom_target('@0@ client header'.format(output_base),
    input: input,
    output: '@0@-client-protocol.h'.format(output_base),
    command: [
      wayland_scanner,
      'client-header',
      '@INPUT@', '@OUTPUT@',
    ]
  )
  libdecor_built_sources += custom_target('@0@ source'.format(output_base),
    input: input,
    output: '@0@-protocol.c'.format(output_base),
    command: [
      wayland_scanner,
      'private-code',
      '@INPUT@', '@OUTPUT@',
    ]
  )
endforeach

## desktop settings
desktop_settings = static_library('desktop_settings',
  sources: ['desktop-settings.c'],
  include_directories: [top_includepath],
  dependencies: [dbus_dep],
  gnu_symbol_visibility: 'hidden',
)

desktop_settings_dep = declare_dependency(
  link_with: desktop_settings,
  dependencies: [dbus_dep],
)

## os compatibility
os_compatibility = static_library('os_compatibility',
  sources: ['os-compatibility.c'],
  include_directories: [top_includepath],
  gnu_symbol_visibility: 'hidden',
)

os_compatibility_dep = declare_dependency(
  link_with: os_compatibility,
)

## core decor library
libdecor = shared_library(libdecor_name,
  sources: [
    libdecor_sources,
    libdecor_built_sources,
  ],
  soversion: libdecor_soversion,
  version: libdecor_libversion,
  include_directories: libdecor_includes,
  gnu_symbol_visibility: 'hidden',
  dependencies: [
    wayland_client_dep,
    dl_dep,
    desktop_settings_dep,
  ],
  install: true
)

libdecor_dep = declare_dependency(
  link_with: libdecor,
  include_directories: [
    libdecor_includepath,
  ],
  dependencies: [
    wayland_client_dep,
  ],
)

## decor plugins
subdir('plugins')

## pkg-config file
pkg.generate(
  name: libdecor_full_name,
  description: 'library for Wayland client-side window decors',
  libraries: libdecor,
  requires_private: [
    'wayland-client',
  ],
  subdirs: libdecor_full_name,
  version: meson.project_version()
)