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 configure_file(output: 'config.h',
32                configuration: config)
33
34 configuration_inc = include_directories('.')
35
36 drm_dep = dependency('libdrm', version: '>= 2.4.89')
37 thread_dep = dependency('threads')
38 toml_dep = dependency('libtoml')
39
40 enable_tests = get_option('enable-tests')
41
42 if enable_tests
43   check_dep = dependency('check')
44
45 # Default to the system provided version of fff.h.
46 # otherwise fetch it ourselves.
47   if cc.check_header('fff.h')
48     fff_dep = declare_dependency()
49   else
50     if meson.version().version_compare('>=0.55')
51       fff_proj = subproject('fff')
52       fff_dep = fff_proj.get_variable('fff_dep')
53     else
54       error('Update meson version to >=0.55 to enable unit testing')
55     endif
56   endif
57 endif
58
59 subdir('common')
60 subdir('libdlmclient')
61 subdir('drm-lease-manager')
62 subdir('examples')