xref: /aosp_15_r20/external/libtraceevent/meson.build (revision 436bf2bcd5202612ffffe471bbcc1f277cc8d28e)
1# SPDX-License-Identifier: LGPL-2.1
2#
3# Copyright (c) 2023 Daniel Wagner, SUSE LLC
4
5project(
6    'libtraceevent', ['c'],
7    meson_version: '>= 0.58.0',
8    license: 'LGPL-2.1',
9    version: '1.8.4',
10    default_options: [
11        'c_std=gnu99',
12        'buildtype=debug',
13        'default_library=both',
14        'prefix=/usr/local',
15        'warning_level=1',
16    ])
17
18library_version = meson.project_version()
19
20cunit_dep = dependency('cunit', required : false)
21
22prefixdir = get_option('prefix')
23mandir = join_paths(prefixdir, get_option('mandir'))
24htmldir = join_paths(prefixdir, get_option('htmldir'))
25libdir = join_paths(prefixdir, get_option('libdir'))
26plugindir = get_option('plugindir')
27if plugindir == ''
28    plugindir = join_paths(libdir, 'traceevent/plugins')
29endif
30
31add_project_arguments(
32    [
33        '-D_GNU_SOURCE',
34        '-DPLUGIN_DIR="@0@"'.format(plugindir),
35    ],
36    language : 'c',
37)
38
39incdir = include_directories(['include', 'include/traceevent'])
40
41subdir('src')
42subdir('include/traceevent')
43subdir('plugins')
44if cunit_dep.found()
45    subdir('utest')
46endif
47subdir('samples')
48
49if get_option('doc')
50subdir('Documentation')
51
52custom_target(
53    'docs',
54    output: 'docs',
55    depends: [html, man],
56    command: ['echo'])
57endif
58