mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-12 16:10:54 +00:00
Merge branch 'meson' of https://gitlab.gnome.org/tristan957/sysprof
This commit is contained in:
@ -3,7 +3,7 @@ libeggbitset_sources = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
libeggbitset_deps = [
|
libeggbitset_deps = [
|
||||||
dependency('gio-2.0', version: glib_req_version),
|
gio_dep,
|
||||||
]
|
]
|
||||||
|
|
||||||
libeggbitset_static = static_library('eggbitset', libeggbitset_sources,
|
libeggbitset_static = static_library('eggbitset', libeggbitset_sources,
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
liblinereader_deps = [
|
liblinereader_deps = [
|
||||||
dependency('gio-2.0', version: glib_req_version),
|
gio_dep,
|
||||||
]
|
]
|
||||||
|
|
||||||
liblinereader_static_dep = declare_dependency(
|
liblinereader_static_dep = declare_dependency(
|
||||||
|
|||||||
22
meson.build
22
meson.build
@ -1,7 +1,7 @@
|
|||||||
project('sysprof', ['c', 'cpp'],
|
project('sysprof', 'c', 'cpp',
|
||||||
license: ['GPL3+', 'GPL2+'],
|
license: 'GPL-3.0-or-later OR GPL-2.0-or-later',
|
||||||
version: '45.alpha',
|
version: '45.alpha',
|
||||||
meson_version: '>=0.59.0',
|
meson_version: '>=0.62.0',
|
||||||
default_options: [ 'c_std=gnu17',
|
default_options: [ 'c_std=gnu17',
|
||||||
'cpp_std=gnu++17',
|
'cpp_std=gnu++17',
|
||||||
'warning_level=2',
|
'warning_level=2',
|
||||||
@ -39,7 +39,7 @@ need_glib = (need_gtk or
|
|||||||
get_option('examples') or
|
get_option('examples') or
|
||||||
get_option('sysprofd') != 'none' or
|
get_option('sysprofd') != 'none' or
|
||||||
get_option('tools') or
|
get_option('tools') or
|
||||||
get_option('tests'))
|
get_option('tests'))
|
||||||
need_libsysprof = (need_gtk or
|
need_libsysprof = (need_gtk or
|
||||||
get_option('libsysprof') or
|
get_option('libsysprof') or
|
||||||
get_option('examples') or
|
get_option('examples') or
|
||||||
@ -60,18 +60,20 @@ cc = meson.get_compiler('c')
|
|||||||
cxx = meson.get_compiler('cpp')
|
cxx = meson.get_compiler('cpp')
|
||||||
|
|
||||||
glib_dep = dependency('glib-2.0', version: glib_req_version, required: need_glib)
|
glib_dep = dependency('glib-2.0', version: glib_req_version, required: need_glib)
|
||||||
|
gio_dep = dependency('gio-2.0', version: glib_req_version, required: need_glib)
|
||||||
|
gio_unix_dep = dependency('gio-unix-2.0', version: glib_req_version, required: host_machine.system() != 'windows')
|
||||||
gtk_dep = dependency('gtk4', version: gtk_req_version, required: need_gtk)
|
gtk_dep = dependency('gtk4', version: gtk_req_version, required: need_gtk)
|
||||||
libsystemd_dep = dependency('libsystemd', required: false)
|
libsystemd_dep = dependency('libsystemd', required: false)
|
||||||
|
|
||||||
config_h = configuration_data()
|
config_h = configuration_data()
|
||||||
config_h.set_quoted('SYMBOLIC_VERSION', symbolic_version)
|
config_h.set_quoted('SYMBOLIC_VERSION', symbolic_version)
|
||||||
config_h.set_quoted('API_VERSION_S', '@0@'.format(libsysprof_api_version))
|
config_h.set_quoted('API_VERSION_S', libsysprof_api_version.to_string())
|
||||||
config_h.set_quoted('PACKAGE_NAME', 'sysprof')
|
config_h.set_quoted('PACKAGE_NAME', 'sysprof')
|
||||||
config_h.set_quoted('PACKAGE_VERSION', meson.project_version())
|
config_h.set_quoted('PACKAGE_VERSION', meson.project_version())
|
||||||
config_h.set_quoted('PACKAGE_STRING', 'sysprof-' + meson.project_version())
|
config_h.set_quoted('PACKAGE_STRING', 'sysprof-' + meson.project_version())
|
||||||
config_h.set_quoted('PACKAGE_BUGREPORT', 'https://gitlab.gnome.org/GNOME/sysprof/-/issues/new')
|
config_h.set_quoted('PACKAGE_BUGREPORT', 'https://gitlab.gnome.org/GNOME/sysprof/-/issues/new')
|
||||||
config_h.set_quoted('PACKAGE_LIBEXECDIR', join_paths(get_option('prefix'), get_option('libexecdir')))
|
config_h.set_quoted('PACKAGE_LIBEXECDIR', get_option('libexecdir'))
|
||||||
config_h.set_quoted('PACKAGE_LIBDIR', join_paths(get_option('prefix'), get_option('libdir')))
|
config_h.set_quoted('PACKAGE_LIBDIR', get_option('libdir'))
|
||||||
config_h.set('PACKAGE_TARNAME', 'PACKAGE_STRING')
|
config_h.set('PACKAGE_TARNAME', 'PACKAGE_STRING')
|
||||||
config_h.set('PACKAGE', 'PACKAGE_NAME')
|
config_h.set('PACKAGE', 'PACKAGE_NAME')
|
||||||
config_h.set('VERSION', 'PACKAGE_VERSION')
|
config_h.set('VERSION', 'PACKAGE_VERSION')
|
||||||
@ -120,9 +122,7 @@ if get_option('libunwind')
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
# Development build setup
|
# Development build setup
|
||||||
if get_option('development')
|
config_h.set10('DEVELOPMENT_BUILD', get_option('development'))
|
||||||
config_h.set10('DEVELOPMENT_BUILD', true)
|
|
||||||
endif
|
|
||||||
|
|
||||||
has_use_clockid = cc.has_member('struct perf_event_attr',
|
has_use_clockid = cc.has_member('struct perf_event_attr',
|
||||||
'use_clockid',
|
'use_clockid',
|
||||||
@ -133,7 +133,7 @@ has_clockid = cc.has_member('struct perf_event_attr',
|
|||||||
config_h.set('HAVE_PERF_CLOCKID', has_use_clockid and has_clockid)
|
config_h.set('HAVE_PERF_CLOCKID', has_use_clockid and has_clockid)
|
||||||
|
|
||||||
# For config.h
|
# For config.h
|
||||||
add_project_arguments(['-I'+meson.current_build_dir()], language: 'c')
|
add_project_arguments('-I' + meson.current_build_dir(), language: 'c')
|
||||||
|
|
||||||
global_c_args = [
|
global_c_args = [
|
||||||
'-DSYSPROF_COMPILATION',
|
'-DSYSPROF_COMPILATION',
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
# If this is a development build, which is used for our Flatpak build
|
# If this is a development build, which is used for our Flatpak build
|
||||||
# so that we have a different app-id (.Devel suffix) than the regular
|
# so that we have a different app-id (.Devel suffix) than the regular
|
||||||
# application.
|
# application.
|
||||||
option('development', type: 'boolean', value: 'false')
|
option('development', type: 'boolean', value: false)
|
||||||
|
|
||||||
# Optionally disable the GTK application in case you're building the
|
# Optionally disable the GTK application in case you're building the
|
||||||
# sysprof-cli only for your platform. Might be useful in IoT or various
|
# sysprof-cli only for your platform. Might be useful in IoT or various
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
install_static = not meson.is_subproject() and get_option('install-static')
|
install_static = not meson.is_subproject() and get_option('install-static')
|
||||||
|
|
||||||
libsysprof_capture_headers = files([
|
libsysprof_capture_headers = files(
|
||||||
'sysprof-address.h',
|
'sysprof-address.h',
|
||||||
'sysprof-clock.h',
|
'sysprof-clock.h',
|
||||||
'sysprof-capture-condition.h',
|
'sysprof-capture-condition.h',
|
||||||
@ -13,17 +13,17 @@ libsysprof_capture_headers = files([
|
|||||||
'sysprof-platform.h',
|
'sysprof-platform.h',
|
||||||
'sysprof-capture.h',
|
'sysprof-capture.h',
|
||||||
'sysprof-version-macros.h',
|
'sysprof-version-macros.h',
|
||||||
])
|
)
|
||||||
|
|
||||||
if not meson.is_subproject()
|
if not meson.is_subproject()
|
||||||
install_headers(libsysprof_capture_headers, subdir: sysprof_header_subdir)
|
install_headers(libsysprof_capture_headers, subdir: sysprof_header_subdir)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
mapped_ring_buffer_sources = files([
|
mapped_ring_buffer_sources = files(
|
||||||
'mapped-ring-buffer.c',
|
'mapped-ring-buffer.c',
|
||||||
])
|
)
|
||||||
|
|
||||||
libsysprof_capture_sources = files([
|
libsysprof_capture_sources = files(
|
||||||
'sysprof-address.c',
|
'sysprof-address.c',
|
||||||
'sysprof-capture-condition.c',
|
'sysprof-capture-condition.c',
|
||||||
'sysprof-capture-cursor.c',
|
'sysprof-capture-cursor.c',
|
||||||
@ -34,7 +34,7 @@ libsysprof_capture_sources = files([
|
|||||||
'sysprof-collector.c',
|
'sysprof-collector.c',
|
||||||
'sysprof-clock.c',
|
'sysprof-clock.c',
|
||||||
'sysprof-platform.c',
|
'sysprof-platform.c',
|
||||||
])
|
)
|
||||||
|
|
||||||
configure_file(
|
configure_file(
|
||||||
input: 'sysprof-version.h.in',
|
input: 'sysprof-version.h.in',
|
||||||
@ -55,7 +55,6 @@ libsysprof_capture = static_library(
|
|||||||
|
|
||||||
dependencies: libsysprof_capture_deps,
|
dependencies: libsysprof_capture_deps,
|
||||||
c_args: [ '-DSYSPROF_CAPTURE_COMPILATION' ],
|
c_args: [ '-DSYSPROF_CAPTURE_COMPILATION' ],
|
||||||
install_dir: get_option('libdir'),
|
|
||||||
install: install_static,
|
install: install_static,
|
||||||
gnu_symbol_visibility: 'hidden',
|
gnu_symbol_visibility: 'hidden',
|
||||||
pic: true,
|
pic: true,
|
||||||
@ -75,7 +74,6 @@ if install_static
|
|||||||
libsysprof_capture,
|
libsysprof_capture,
|
||||||
subdirs: [ sysprof_header_subdir ],
|
subdirs: [ sysprof_header_subdir ],
|
||||||
description: 'The static capture library for tools that generate profiling capture data',
|
description: 'The static capture library for tools that generate profiling capture data',
|
||||||
install_dir: join_paths(get_option('libdir'), 'pkgconfig'),
|
|
||||||
variables: [ 'datadir=' + datadir_for_pc_file ],
|
variables: [ 'datadir=' + datadir_for_pc_file ],
|
||||||
libraries_private: libsysprof_capture_deps,
|
libraries_private: libsysprof_capture_deps,
|
||||||
)
|
)
|
||||||
|
|||||||
@ -25,7 +25,7 @@ libsysprof_capture_testsuite = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
libsysprof_capture_testsuite_deps = [
|
libsysprof_capture_testsuite_deps = [
|
||||||
dependency('gio-2.0'),
|
gio_dep,
|
||||||
libsysprof_capture_dep,
|
libsysprof_capture_dep,
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
@ -171,10 +171,8 @@ libsysprof_resources = gnome.compile_resources('libsysprof-resources', 'libsyspr
|
|||||||
)
|
)
|
||||||
|
|
||||||
libsysprof_deps = [
|
libsysprof_deps = [
|
||||||
dependency('gio-2.0', version: glib_req_version),
|
gio_dep,
|
||||||
dependency('gio-unix-2.0',
|
gio_unix_dep,
|
||||||
version: glib_req_version,
|
|
||||||
required: host_machine.system() != 'windows'),
|
|
||||||
dependency('libdex-1', version: dex_req_version),
|
dependency('libdex-1', version: dex_req_version),
|
||||||
dependency('json-glib-1.0'),
|
dependency('json-glib-1.0'),
|
||||||
|
|
||||||
@ -225,7 +223,6 @@ meson.override_dependency('sysprof-@0@'.format(soname_major_version), libsysprof
|
|||||||
pkgconfig.generate(libsysprof,
|
pkgconfig.generate(libsysprof,
|
||||||
subdirs: [sysprof_header_subdir],
|
subdirs: [sysprof_header_subdir],
|
||||||
description: 'A library for recording and analyzing system performance',
|
description: 'A library for recording and analyzing system performance',
|
||||||
install_dir: join_paths(get_option('libdir'), 'pkgconfig'),
|
|
||||||
requires: ['gio-2.0'],
|
requires: ['gio-2.0'],
|
||||||
variables: ['datadir=' + datadir_for_pc_file],
|
variables: ['datadir=' + datadir_for_pc_file],
|
||||||
)
|
)
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
libdl_dep = cc.find_library('dl', required: false)
|
libdl_dep = dependency('dl', required: false)
|
||||||
|
|
||||||
preload_deps = [
|
preload_deps = [
|
||||||
dependency('glib-2.0'),
|
dependency('glib-2.0'),
|
||||||
@ -15,19 +15,16 @@ libsysprof_memory_preload = shared_library('sysprof-memory-@0@'.format(libsyspro
|
|||||||
['sysprof-memory-collector.c'],
|
['sysprof-memory-collector.c'],
|
||||||
dependencies: preload_deps,
|
dependencies: preload_deps,
|
||||||
install: true,
|
install: true,
|
||||||
install_dir: get_option('libdir'),
|
|
||||||
)
|
)
|
||||||
|
|
||||||
libsysprof_speedtrack_preload = shared_library('sysprof-speedtrack-@0@'.format(libsysprof_api_version),
|
libsysprof_speedtrack_preload = shared_library('sysprof-speedtrack-@0@'.format(libsysprof_api_version),
|
||||||
['sysprof-speedtrack-collector.c'],
|
['sysprof-speedtrack-collector.c'],
|
||||||
dependencies: preload_deps,
|
dependencies: preload_deps,
|
||||||
install: true,
|
install: true,
|
||||||
install_dir: get_option('libdir'),
|
|
||||||
)
|
)
|
||||||
|
|
||||||
libsysprof_tracer_preload = shared_library('sysprof-tracer-@0@'.format(libsysprof_api_version),
|
libsysprof_tracer_preload = shared_library('sysprof-tracer-@0@'.format(libsysprof_api_version),
|
||||||
['sysprof-tracer-collector.c'],
|
['sysprof-tracer-collector.c'],
|
||||||
dependencies: preload_deps,
|
dependencies: preload_deps,
|
||||||
install: true,
|
install: true,
|
||||||
install_dir: get_option('libdir'),
|
|
||||||
)
|
)
|
||||||
|
|||||||
@ -19,10 +19,9 @@ sysprof_agent_deps = [
|
|||||||
sysprof_agent = executable('sysprof-agent', sysprof_agent_sources,
|
sysprof_agent = executable('sysprof-agent', sysprof_agent_sources,
|
||||||
dependencies: sysprof_agent_deps,
|
dependencies: sysprof_agent_deps,
|
||||||
c_args: release_flags + sysprof_agent_c_args,
|
c_args: release_flags + sysprof_agent_c_args,
|
||||||
install_dir: get_option('bindir'),
|
|
||||||
install: true,
|
install: true,
|
||||||
)
|
)
|
||||||
|
|
||||||
install_data(['org.gnome.Sysprof.Agent.xml'],
|
install_data('org.gnome.Sysprof.Agent.xml',
|
||||||
install_dir: join_paths(datadir, 'dbus-1/interfaces'),
|
install_dir: join_paths(datadir, 'dbus-1/interfaces'),
|
||||||
)
|
)
|
||||||
|
|||||||
@ -14,6 +14,5 @@ sysprof_cli_deps = [
|
|||||||
sysprof_cli = executable('sysprof-cli', sysprof_cli_sources,
|
sysprof_cli = executable('sysprof-cli', sysprof_cli_sources,
|
||||||
dependencies: sysprof_cli_deps,
|
dependencies: sysprof_cli_deps,
|
||||||
c_args: release_flags + sysprof_cli_c_args,
|
c_args: release_flags + sysprof_cli_c_args,
|
||||||
install_dir: get_option('bindir'),
|
|
||||||
install: true,
|
install: true,
|
||||||
)
|
)
|
||||||
|
|||||||
@ -84,6 +84,5 @@ sysprof_deps = [
|
|||||||
|
|
||||||
sysprof = executable('sysprof', sysprof_resources + sysprof_sources,
|
sysprof = executable('sysprof', sysprof_resources + sysprof_sources,
|
||||||
dependencies: sysprof_deps,
|
dependencies: sysprof_deps,
|
||||||
install_dir: get_option('bindir'),
|
|
||||||
install: true,
|
install: true,
|
||||||
)
|
)
|
||||||
|
|||||||
@ -20,12 +20,12 @@ sysprofd_sources = [
|
|||||||
ipc_service_src,
|
ipc_service_src,
|
||||||
]
|
]
|
||||||
|
|
||||||
pkglibexecdir = join_paths(get_option('prefix'), get_option('libexecdir'))
|
pkglibexecdir = get_option('libexecdir')
|
||||||
|
|
||||||
sysprofd_deps = [
|
sysprofd_deps = [
|
||||||
dependency('glib-2.0', version: glib_req_version),
|
glib_dep,
|
||||||
dependency('gio-2.0', version: glib_req_version),
|
gio_dep,
|
||||||
dependency('gio-unix-2.0', version: glib_req_version),
|
gio_unix_dep,
|
||||||
polkit_dep,
|
polkit_dep,
|
||||||
|
|
||||||
libsysprof_capture_dep,
|
libsysprof_capture_dep,
|
||||||
@ -80,9 +80,8 @@ i18n.merge_file(
|
|||||||
install_dir: join_paths(datadir, 'polkit-1/actions'),
|
install_dir: join_paths(datadir, 'polkit-1/actions'),
|
||||||
)
|
)
|
||||||
|
|
||||||
install_data([
|
install_data(
|
||||||
'org.gnome.Sysprof3.Profiler.xml',
|
'org.gnome.Sysprof3.Profiler.xml',
|
||||||
'org.gnome.Sysprof3.Service.xml',
|
'org.gnome.Sysprof3.Service.xml',
|
||||||
],
|
|
||||||
install_dir: join_paths(datadir, 'dbus-1/interfaces'),
|
install_dir: join_paths(datadir, 'dbus-1/interfaces'),
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user