summaryrefslogtreecommitdiff
path: root/meson.build
blob: dc89abd01c4ce0f4f73ab5975fe52c6b1688f764 (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
project('libvlkn', 'c',
  version: '0.1',
  default_options: ['warning_level=3'])

cc = meson.get_compiler('c')

incls = include_directories('include/')
src = [
  'src/buffer.c',
  'src/pipeline.c',
  'src/renderer.c',
  'src/utils.c',
  'src/window.c',
]

libs = [
  dependency('vulkan'),
  dependency('wayland-client'),
]

wl_protocols = dependency('wayland-protocols').get_variable('pkgdatadir')
wl_scanner = find_program(dependency('wayland-scanner').get_variable('wayland_scanner'))

protos = {
  'xdg-shell': wl_protocols / 'stable/xdg-shell/xdg-shell.xml',
  'xdg-decoration': wl_protocols / 'unstable/xdg-decoration/xdg-decoration-unstable-v1.xml'
}

foreach name, path : protos
  src += custom_target(
    name.underscorify() + '_c',
    input: path,
    output: '@BASENAME@-protocol.c',
    command: [wl_scanner, 'private-code', '@INPUT@', '@OUTPUT@']
  )
  src += custom_target(
    name.underscorify() + '_h',
    input: path,
    output: '@BASENAME@-protocol.h',
    command: [wl_scanner, 'client-header', '@INPUT@', '@OUTPUT@']
  )
endforeach

vlkn = library('libvlkn', src, dependencies: libs, include_directories: incls, install: true)
libvlkn_dep = declare_dependency(link_with: vlkn, include_directories: incls)
meson.override_dependency('libvlkn', libvlkn_dep)

executable('vlkntest', 'src/test.c', dependencies: libvlkn_dep)