File: meson.build

package info (click to toggle)
sysprof 3.30.2-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 2,616 kB
  • sloc: ansic: 20,056; xml: 96; cpp: 23; sh: 18; makefile: 9
file content (143 lines) | stat: -rw-r--r-- 4,105 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143

# We split up the library code into two libraries.  One containing the
# minimum necessary to do profiling on a particular host (that might not
# have GTK+ installed), and the library containing reusable GTK
# components (for IDE integration).

libsysprof_api_version = '2'
libsysprof_header_subdir = 'sysprof-' + libsysprof_api_version

libsysprof_version_conf = configuration_data()
libsysprof_version = meson.project_version().split('.')
libsysprof_version_conf.set('MAJOR_VERSION', libsysprof_version[0])
libsysprof_version_conf.set('MINOR_VERSION', libsysprof_version[1])
libsysprof_version_conf.set('MICRO_VERSION', libsysprof_version[2])
libsysprof_version_conf.set('VERSION', meson.project_version())

configure_file(
          input: 'sysprof-version.h.in',
         output: 'sysprof-version.h',
  configuration: libsysprof_version_conf,
        install: true,
    install_dir: join_paths(get_option('includedir'), 'sysprof-' + libsysprof_api_version)
)

libsysprof_base_headers = [
  'sysprof.h',
  'sysprof-capture.h',
  'sp-address.h',
  'sp-clock.h',
  'sp-error.h',
  'sp-kallsyms.h',
]

libsysprof_base_sources = [
  'sp-address.c',
  'sp-clock.c',
  'sp-error.c',
  'sp-kallsyms.c',
]

libsysprof_headers = libsysprof_base_headers
libsysprof_sources = libsysprof_base_sources

libsysprof_ui_base_headers = ['sysprof-ui.h']
libsysprof_ui_headers = libsysprof_ui_base_headers
libsysprof_ui_sources = []

libsysprof_capture_sources = libsysprof_base_sources

subdir('callgraph')
subdir('capture')
subdir('profiler')
subdir('sources')
subdir('symbols')
subdir('util')
subdir('visualizers')
subdir('widgets')

cxx = meson.get_compiler('cpp')

libsysprof_capture_deps = [
  dependency('glib-2.0'),
]

libsysprof_deps = [
  cxx.find_library('stdc++'),
  dependency('gio-unix-2.0'),
]

version_link_arg = '-Wl,--version-script,' + join_paths(meson.current_source_dir(), 'sysprof.map')
libsysprof_c_args = release_flags + ['-DSP_ENABLE_GOBJECT']

if get_option('with_sysprofd') != 'none'
  libsysprof_deps += dependency('polkit-gobject-1')
  libsysprof_c_args += '-DENABLE_POLKIT'
endif

libsysprof_capture = static_library('sysprof-capture-' + libsysprof_api_version,
  libsysprof_capture_sources,
        c_args: release_flags,
  dependencies: libsysprof_capture_deps,
       install: true,
)

libsysprof = shared_library('sysprof-' + libsysprof_api_version,
  libsysprof_sources,
  dependencies: libsysprof_deps,
        c_args: libsysprof_c_args,
     link_args: version_link_arg,
  link_depends: 'sysprof.map',
       install: true,
)

libsysprof_dep = declare_dependency(
  include_directories: include_directories('.'),
            link_with: libsysprof,
         dependencies: libsysprof_deps,
)

libsysprof_capture_dep = declare_dependency(
  include_directories: include_directories('.'),
            link_with: libsysprof_capture,
         dependencies: libsysprof_capture_deps,
)

install_headers(libsysprof_base_headers, subdir: libsysprof_header_subdir)

if get_option('enable_gtk')
  # This is our GTK library containing the widgets suitable for viewing
  # and manipulating the various profiler API in libsysprof.  This is
  # meant to be used by IDEs and the sysprof gui.

  libsysprof_ui_resources = gnome.compile_resources(
    'sp-ui-resources', 'resources/libsysprof.gresource.xml',
    source_dir: 'resources',
        c_name: 'sp',
  )

  libsysprof_ui_deps = [
    libsysprof_dep,
    dependency('gtk+-3.0', version: '>=3.22.0'),
  ]

  libsysprof_ui_c_args = release_flags + ['-DSP_ENABLE_GOBJECT']

  libsysprof_ui = shared_library('sysprof-ui-' + libsysprof_api_version,
    libsysprof_ui_resources + libsysprof_ui_sources,
    dependencies: libsysprof_ui_deps,
          c_args: libsysprof_ui_c_args,
       link_args: version_link_arg,
    link_depends: 'sysprof.map',
         install: true,
  )

  libsysprof_ui_dep = declare_dependency(
           dependencies: libsysprof_ui_deps,
              link_with: libsysprof_ui,
    include_directories: include_directories('.'),
  )

  install_headers(libsysprof_ui_base_headers, subdir: libsysprof_header_subdir)

endif