Add gbm_server for supporting gbm_bo buffer
[platform/core/uifw/libds-tizen.git] / meson.build
1 project('libds_tizen',
2   ['c', 'cpp'],
3   license: 'MIT',
4   version: '0.1.2',
5   default_options: [
6     'warning_level=1',
7     'c_std=gnu99', 'cpp_std=c++20',
8     'buildtype=debug'
9   ]
10 )
11
12 cc = meson.get_compiler('c')
13
14 add_project_arguments(cc.get_supported_arguments([
15   '-Wno-missing-field-initializers',
16   '-Wno-unused-parameter',
17   '-Wno-pedantic',
18   '-Wno-missing-braces',
19 ]), language: ['c', 'cpp'])
20
21 # Compute the relative path used by compiler invocations.
22 source_root = meson.current_source_dir().split('/')
23 build_root = meson.global_build_root().split('/')
24 relative_dir_parts = []
25 i = 0
26 in_prefix = true
27 foreach p: build_root
28   if i >= source_root.length() or not in_prefix or p != source_root[i]
29     in_prefix = false
30     relative_dir_parts += '..'
31   endif
32   i += 1
33 endforeach
34 i = 0
35 in_prefix = true
36 foreach p : source_root
37   if i >= build_root.length() or not in_prefix or build_root[i] != p
38     in_prefix = false
39     relative_dir_parts += p
40   endif
41   i += 1
42 endforeach
43 relative_dir = join_paths(relative_dir_parts) + '/'
44
45 if cc.has_argument('-fmacro-prefix-map=/prefix/to/hide=')
46   add_project_arguments(
47     '-fmacro-prefix-map=@0@='.format(relative_dir),
48     language: 'c',
49   )
50 else
51   add_project_arguments(
52     '-D_DS_REL_SRC_DIR="@0@"'.format(relative_dir),
53     language: 'c',
54   )
55 endif
56
57 libds_tizen_version = meson.project_version()
58 version_arr = libds_tizen_version.split('.')
59 libds_tizen_version_major = version_arr[0]
60 libds_tizen_version_minor = version_arr[1]
61 libds_tizen_version_patch = version_arr[2]
62
63 dir_prefix = get_option('prefix')
64 libds_tizen_bindir = join_paths(dir_prefix, get_option('bindir'))
65
66 libds_tizen_inc = include_directories('include')
67
68 cdata = configuration_data()
69 cdata.set('LIBDS_VERSION_MAJOR', libds_tizen_version_major)
70 cdata.set('LIBDS_VERSION_MINOR', libds_tizen_version_minor)
71 cdata.set('LIBDS_VERSION_PATCH', libds_tizen_version_patch)
72
73 wayland_protos = dependency('wayland-protocols',
74   fallback: ['wayland-protocols', 'wayland_protocols'],
75   default_options: ['tests=false'],
76 )
77 wl_protocol_dir = wayland_protos.get_variable('pkgdatadir')
78
79 wayland_scanner_dep = dependency('wayland-scanner', native: true)
80 wayland_scanner = find_program(
81   wayland_scanner_dep.get_variable('wayland_scanner'),
82   native: true,
83 )
84
85 subdir('src')
86 subdir('tests')
87 subdir('examples')
88 subdir('clients')
89 subdir('include')
90
91 configure_file(output: 'config.h', install: false, configuration: cdata)