Debian Codegraph @

src/libsysprof-capture/meson.build

raw
1 install_static = not meson.is_subproject() and get_option('install-static')
2
3 libsysprof_capture_headers = files(
4 'sysprof-address.h',
5 'sysprof-clock.h',
6 'sysprof-capture-condition.h',
7 'sysprof-capture-cursor.h',
8 'sysprof-capture-reader.h',
9 'sysprof-capture-types.h',
10 'sysprof-capture-writer.h',
11 'sysprof-collector.h',
12 'sysprof-macros.h',
13 'sysprof-platform.h',
14 'sysprof-capture.h',
15 'sysprof-version-macros.h',
16 )
17
18 if not meson.is_subproject()
19 install_headers(libsysprof_capture_headers, subdir: sysprof_header_subdir)
20 endif
21
22 mapped_ring_buffer_sources = files(
23 'mapped-ring-buffer.c',
24 )
25
26 libsysprof_capture_sources = files(
27 'sysprof-address.c',
28 'sysprof-capture-condition.c',
29 'sysprof-capture-cursor.c',
30 'sysprof-capture-reader.c',
31 'sysprof-capture-util.c',
32 'sysprof-capture-writer.c',
33 'sysprof-capture-writer-cat.c',
34 'sysprof-collector.c',
35 'sysprof-clock.c',
36 'sysprof-platform.c',
37 )
38
39 configure_file(
40 input: 'sysprof-version.h.in',
41 output: 'sysprof-version.h',
42 configuration: sysprof_version_conf,
43 install_dir: join_paths(get_option('includedir'), sysprof_header_subdir),
44 install: not meson.is_subproject(),
45 )
46
47 libsysprof_capture_deps = [
48 dependency('threads'),
49 ]
50
51 libsysprof_capture_link_args = []
52 if cc.has_link_argument('-Wl,-z,nodelete')
53 libsysprof_capture_link_args += ['-Wl,-z,nodelete']
54 endif
55
56 libsysprof_capture = static_library(
57 'sysprof-capture-@0@'.format(libsysprof_capture_api_version),
58 (libsysprof_capture_sources +
59 mapped_ring_buffer_sources),
60
61 dependencies: libsysprof_capture_deps,
62 c_args: [ '-DSYSPROF_CAPTURE_COMPILATION' ],
63 link_args: libsysprof_capture_link_args,
64 install: install_static,
65 gnu_symbol_visibility: 'hidden',
66 pic: true,
67 )
68
69 libsysprof_capture_include_dirs = include_directories('.')
70
71 libsysprof_capture_dep = declare_dependency(
72 link_whole: libsysprof_capture,
73 dependencies: libsysprof_capture_deps,
74 include_directories: libsysprof_capture_include_dirs,
75 link_args: libsysprof_capture_link_args,
76 )
77 meson.override_dependency('sysprof-capture-@0@'.format(libsysprof_capture_api_version), libsysprof_capture_dep)
78
79 if install_static
80 pkgconfig.generate(
81 libsysprof_capture,
82 subdirs: [ sysprof_header_subdir ],
83 description: 'The static capture library for tools that generate profiling capture data',
84 variables: [ 'datadir=' + datadir_for_pc_file ],
85 libraries: libsysprof_capture_link_args,
86 libraries_private: libsysprof_capture_deps,
87 )
88 endif
89
90 if get_option('tests')
91 subdir('tests')
92 endif