Add gitlab issue/merge request templates
[src/drm-lease-manager.git] / meson.build
1 project(
2     'lease_manager', 'c',
3     # Version based on Semantic Versioning 2.0.0 (https://semver.org/)
4     version: '0.1.0',
5     default_options: [
6         'warning_level=2',
7     ]
8 )
9
10 config = configuration_data()
11
12 pkg = import('pkgconfig')
13
14 compiler_flags = [
15     '-Wstrict-prototypes',
16     '-Wmissing-prototypes',
17 ]
18
19 #Setup and create runtime path
20 runtime_path = join_paths(get_option('localstatedir'), get_option('runtime_subdir'))
21 config.set_quoted('DLM_DEFAULT_RUNTIME_PATH', runtime_path)
22
23 meson.add_install_script('sh', '-c', 'install -d $DESTDIR/$1', '_', runtime_path)
24
25 cc = meson.get_compiler('c')
26 add_project_arguments(
27     cc.get_supported_arguments(compiler_flags),
28     language: 'c'
29 )
30
31 drm_dep = dependency('libdrm', version: '>= 2.4.89')
32 thread_dep = dependency('threads')
33 toml_dep = dependency('libtoml')
34
35 systemd_dep = dependency('', required: false)
36 if get_option('enable-systemd')
37         systemd_dep = dependency('libsystemd', required: false)
38
39         config.set('HAVE_SYSTEMD_DAEMON', '1')
40 endif
41
42 enable_tests = get_option('enable-tests')
43
44 if enable_tests
45   check_dep = dependency('check')
46
47 # Default to the system provided version of fff.h.
48 # otherwise fetch it ourselves.
49   if cc.check_header('fff.h')
50     fff_dep = declare_dependency()
51   else
52     if meson.version().version_compare('>=0.55')
53       fff_proj = subproject('fff')
54       fff_dep = fff_proj.get_variable('fff_dep')
55     else
56       error('Update meson version to >=0.55 to enable unit testing')
57     endif
58   endif
59 endif
60
61 configure_file(output: 'config.h',
62                configuration: config)
63
64 configuration_inc = include_directories('.')
65
66 subdir('common')
67 subdir('libdlmclient')
68 subdir('drm-lease-manager')
69 subdir('examples')