Update README to describe configuration file format
[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     '-Wno-missing-field-initializers',
18 ]
19
20 #Setup and create runtime path
21 runtime_path = join_paths(get_option('localstatedir'), get_option('runtime_subdir'))
22 config.set_quoted('DLM_DEFAULT_RUNTIME_PATH', runtime_path)
23
24 meson.add_install_script('sh', '-c', 'install -d $DESTDIR/$1', '_', runtime_path)
25
26 cc = meson.get_compiler('c')
27 add_project_arguments(
28     cc.get_supported_arguments(compiler_flags),
29     language: 'c'
30 )
31
32 configure_file(output: 'config.h',
33                configuration: config)
34
35 configuration_inc = include_directories('.')
36
37 drm_dep = dependency('libdrm', version: '>= 2.4.89')
38 thread_dep = dependency('threads')
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')