blob: 765011315bf32024e8134e5f361645c87d09cc08 [file] [log] [blame]
Ed Tanous9b322cb2023-07-26 10:42:51 -07001project(
2 'jsnbd',
3 'c',
4 version : '1.0',
5 meson_version: '>=0.63.0',
6 default_options: [
7 'b_ndebug=if-release',
8 'cpp_rtti=false',
9 'cpp_std=c++20',
10 'warning_level=3',
11 'werror=true',
12 ]
13)
14
15bindir = get_option('prefix') + '/' + get_option('bindir')
16localstatedir = get_option('localstatedir')
17sysconfdir = get_option('sysconfdir')
18
19c = meson.get_compiler('c')
20
21json_c = dependency('json-c', include_type: 'system')
22udev = c.find_library('udev')
23
24conf_data = configuration_data()
25
26if c.has_header_symbol('fcntl.h', 'splice', args: '-D_GNU_SOURCE')
27 conf_data.set('HAVE_SPLICE', 1)
28endif
29
30conf_data.set('RUNSTATEDIR', '"' + localstatedir + '/run"')
31conf_data.set('SYSCONFDIR', '"' + sysconfdir + '"')
32
33conf_h_dep = declare_dependency(
34 sources: configure_file(
35 output: 'config.h',
36 configuration: conf_data
37 )
38)
39
40add_project_arguments([
41 '-Wno-pedantic',
42], language : 'c')
43
44executable(
45 'nbd-proxy',
46 'nbd-proxy.c',
47 dependencies: [
48 json_c,
49 conf_h_dep,
50 udev,
51 ],
52 install: true,
53 install_dir: bindir
54)