Add meson.build

shader-damage
Andri Yngvason 2019-10-12 15:24:57 +00:00
parent 9cd6811efa
commit f0bca570b2
2 changed files with 107 additions and 0 deletions

67
meson.build 100644
View File

@ -0,0 +1,67 @@
project(
'wayvnc',
'c',
version: '0.0.0',
license: 'ISC',
default_options: [
'c_std=gnu11',
],
)
add_project_arguments([
'-D_GNU_SOURCE',
'-fvisibility=hidden',
], language: 'c')
cc = meson.get_compiler('c')
libm = cc.find_library('m', required: false)
pixman = dependency('pixman-1')
libuv = dependency('libuv')
egl = dependency('egl')
glesv2 = dependency('glesv2')
wayland_client = dependency('wayland-client')
neatvnc_project = subproject(
'neatvnc',
required: false,
)
if neatvnc_project.found()
neatvnc = neatvnc_project.get_variable('neatvnc_dep')
else
neatvnc = dependency('neatvnc')
endif
inc = include_directories('include')
subdir('protocols')
sources = [
'src/main.c',
'src/render.c',
'src/dmabuf.c',
'src/strlcpy.c',
'src/shm.c',
'src/screencopy.c',
]
dependencies = [
libm,
pixman,
libuv,
egl,
glesv2,
wayland_client,
neatvnc,
client_protos,
]
executable(
'wayvnc',
sources,
dependencies: dependencies,
include_directories: inc,
install: true,
)

View File

@ -0,0 +1,40 @@
wayland_scanner = find_program('wayland-scanner')
wayland_client = dependency('wayland-client')
wayland_scanner_code = generator(
wayland_scanner,
output: '@BASENAME@.c',
arguments: ['private-code', '@INPUT@', '@OUTPUT@'],
)
wayland_scanner_client = generator(
wayland_scanner,
output: '@BASENAME@.h',
arguments: ['client-header', '@INPUT@', '@OUTPUT@'],
)
client_protocols = [
'wlr-export-dmabuf-unstable-v1.xml',
'wlr-screencopy-unstable-v1.xml',
]
client_protos_src = []
client_protos_headers = []
foreach xml: client_protocols
client_protos_src += wayland_scanner_code.process(xml)
client_protos_headers += wayland_scanner_client.process(xml)
endforeach
lib_client_protos = static_library(
'client_protos',
client_protos_src + client_protos_headers,
dependencies: [
wayland_client
]
)
client_protos = declare_dependency(
link_with: lib_client_protos,
sources: client_protos_headers,
)