summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorAnna (navi) Figueiredo Gomes <navi@vlhl.dev>2024-06-30 22:23:08 +0200
committerAnna (navi) Figueiredo Gomes <navi@vlhl.dev>2024-06-30 22:29:30 +0200
commit87c8428df0bf1b2f6932bb16390f69be57e21f6b (patch)
tree0cc0f7cab79a0373ef366898df8f5773391bae17 /meson.build
libvlkn: inital commit, basic prototype api in placeHEADmain
Signed-off-by: Anna (navi) Figueiredo Gomes <navi@vlhl.dev>
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build48
1 files changed, 48 insertions, 0 deletions
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..dc89abd
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,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)