Cleanup the build a bit

Makes the Meson build a little bit better and cleans up some of the
formatting.
This commit is contained in:
Tristan Partin
2022-05-25 14:07:02 -05:00
parent 37e9ca2e5f
commit 757d36ae8e
14 changed files with 136 additions and 177 deletions

View File

@ -1,5 +1,3 @@
if get_option('enable_gtk') and get_option('libsysprof')
libsysprof_ui_public_sources = [
'sysprof-check.c',
'sysprof-display.c',
@ -135,5 +133,3 @@ pkgconfig.generate(
)
install_headers(libsysprof_ui_public_headers, subdir: sysprof_ui_header_subdir)
endif

View File

@ -1,5 +1,3 @@
if get_option('libsysprof')
libsysprof_c_args = [ '-DSYSPROF_COMPILATION' ]
libsysprof_public_sources = [
@ -195,5 +193,3 @@ pkgconfig.generate(
install_headers(libsysprof_public_headers, subdir: sysprof_header_subdir)
subdir('preload')
endif

View File

@ -8,7 +8,7 @@ sysprof_version_conf.set('MINOR_VERSION', sysprof_version[1])
sysprof_version_conf.set('MICRO_VERSION', sysprof_version[2])
sysprof_version_conf.set('VERSION', meson.project_version())
if get_option('with_sysprofd') == 'bundled' or get_option('libsysprof')
if get_option('sysprofd') == 'bundled' or get_option('libsysprof')
ipc_profiler_src = gnome.gdbus_codegen('ipc-profiler',
sources: 'org.gnome.Sysprof3.Profiler.xml',
interface_prefix: 'org.gnome.Sysprof3.',
@ -43,18 +43,26 @@ endif
ipc_include_dirs = include_directories('.')
stackstash_sources = files([
'stackstash.c',
])
stackstash_sources = files('stackstash.c')
helpers_sources = files([
'helpers.c',
])
helpers_sources = files('helpers.c')
subdir('libsysprof-capture')
subdir('sysprofd')
subdir('libsysprof')
subdir('libsysprof-ui')
subdir('sysprof')
subdir('tools')
subdir('tests')
if get_option('sysprofd') == 'bundled'
subdir('sysprofd')
endif
if get_option('libsysprof')
subdir('libsysprof')
endif
if get_option('gtk') and get_option('libsysprof')
subdir('libsysprof-ui')
endif
if get_option('gtk') and get_option('libsysprof')
subdir('sysprof')
endif
if get_option('tools')
subdir('tools')
endif
if get_option('tests')
subdir('tests')
endif

View File

@ -1,5 +1,3 @@
if get_option('enable_gtk') and get_option('libsysprof')
sysprof_sources = [
'egg-binding-group.c',
'sysprof.c',
@ -26,5 +24,3 @@ sysprof = executable('sysprof', sysprof_resources + sysprof_sources,
install_dir: get_option('bindir'),
install: true,
)
endif

View File

@ -1,5 +1,3 @@
if get_option('with_sysprofd') == 'bundled'
sysprofd_sources = [
'../libsysprof/sysprof-kallsyms.c',
'sysprofd.c',
@ -96,5 +94,3 @@ configure_file(
configuration: sysprofdconf,
install_dir: systemdunitdir,
)
endif

View File

@ -1,5 +1,3 @@
if get_option('enable_tests')
test_env = [
'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()),
'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir()),
@ -39,117 +37,112 @@ find_temp_allocs = executable('find-temp-allocs', 'find-temp-allocs.c',
dependencies: test_capture_deps,
)
test('test-capture', test_capture, env: test_env)
test('test-capture-cursor', test_capture_cursor, env: test_env)
test('test-mapped-ring-buffer', test_mapped_ring_buffer, env: test_env)
if get_option('libsysprof')
test_deps = [
libsysprof_static_dep,
]
test_addr_map = executable('test-addr-map', 'test-addr-map.c',
c_args: test_cflags,
dependencies: test_deps,
)
test_addr_decode = executable('test-addr-decode', 'test-addr-decode.c',
c_args: test_cflags,
dependencies: test_deps,
)
test_mountinfo = executable('test-mountinfo', 'test-mountinfo.c',
c_args: test_cflags,
dependencies: test_deps,
)
test_flatpak = executable('test-flatpak', 'test-flatpak.c',
c_args: test_cflags,
dependencies: test_deps,
)
test_resolvers = executable('test-resolvers', 'test-resolvers.c',
c_args: test_cflags,
dependencies: test_deps,
)
allocs_by_size = executable('allocs-by-size', 'allocs-by-size.c',
c_args: test_cflags,
dependencies: test_deps,
)
allocs_within_mark = executable('allocs-within-mark', 'allocs-within-mark.c',
c_args: test_cflags,
dependencies: test_deps,
)
cross_thread_frees = executable('cross-thread-frees', 'cross-thread-frees.c',
c_args: test_cflags,
dependencies: test_deps,
)
memory_stack_stash = executable('memory-stack-stash', 'memory-stack-stash.c',
c_args: test_cflags,
dependencies: test_deps,
)
read_build_id = executable('read-build-id', 'read-build-id.c',
c_args: test_cflags,
dependencies: test_deps,
)
show_page_usage = executable('show-page-usage', 'show-page-usage.c',
c_args: test_cflags,
dependencies: test_deps + [dependency('cairo')],
)
list_pid_maps = executable('list-all-maps', 'list-all-maps.c',
c_args: test_cflags,
dependencies: [libsysprof_static_dep],
include_directories: include_directories('..'),
)
list_maps = executable('list-maps', 'list-maps.c',
c_args: test_cflags,
dependencies: [libsysprof_static_dep],
include_directories: include_directories('..'),
)
if get_option('enable_gtk')
test_ui_deps = [
libsysprof_dep,
libsysprof_ui_dep,
dependency('gtk4', version: gtk_req_version),
dependency('pangoft2', required: false),
test_deps = [
libsysprof_static_dep,
]
test_model_filter = executable('test-model-filter', 'test-model-filter.c',
test_addr_map = executable('test-addr-map', 'test-addr-map.c',
c_args: test_cflags,
dependencies: test_ui_deps,
dependencies: test_deps,
)
test_process_model = executable('test-process-model', 'test-process-model.c',
test_addr_decode = executable('test-addr-decode', 'test-addr-decode.c',
c_args: test_cflags,
dependencies: test_ui_deps,
dependencies: test_deps,
)
test_zoom = executable('test-zoom',
['test-zoom.c', '../libsysprof-ui/sysprof-zoom-manager.c'],
test_mountinfo = executable('test-mountinfo', 'test-mountinfo.c',
c_args: test_cflags,
dependencies: test_ui_deps,
dependencies: test_deps,
)
test_capture_view = executable('test-capture-view', 'test-capture-view.c',
test_flatpak = executable('test-flatpak', 'test-flatpak.c',
c_args: test_cflags,
dependencies: test_ui_deps,
dependencies: test_deps,
)
test('test-model-filter', test_model_filter, env: test_env)
test('test-zoom', test_zoom, env: test_env)
test_resolvers = executable('test-resolvers', 'test-resolvers.c',
c_args: test_cflags,
dependencies: test_deps,
)
endif
endif
allocs_by_size = executable('allocs-by-size', 'allocs-by-size.c',
c_args: test_cflags,
dependencies: test_deps,
)
allocs_within_mark = executable('allocs-within-mark', 'allocs-within-mark.c',
c_args: test_cflags,
dependencies: test_deps,
)
cross_thread_frees = executable('cross-thread-frees', 'cross-thread-frees.c',
c_args: test_cflags,
dependencies: test_deps,
)
memory_stack_stash = executable('memory-stack-stash', 'memory-stack-stash.c',
c_args: test_cflags,
dependencies: test_deps,
)
read_build_id = executable('read-build-id', 'read-build-id.c',
c_args: test_cflags,
dependencies: test_deps,
)
show_page_usage = executable('show-page-usage', 'show-page-usage.c',
c_args: test_cflags,
dependencies: test_deps + [dependency('cairo')],
)
list_pid_maps = executable('list-all-maps', 'list-all-maps.c',
c_args: test_cflags,
dependencies: [libsysprof_static_dep],
include_directories: include_directories('..'),
)
list_maps = executable('list-maps', 'list-maps.c',
c_args: test_cflags,
dependencies: [libsysprof_static_dep],
include_directories: include_directories('..'),
)
if get_option('gtk')
test_ui_deps = [
libsysprof_dep,
libsysprof_ui_dep,
dependency('gtk4', version: gtk_req_version),
dependency('pangoft2', required: false),
]
test_model_filter = executable('test-model-filter', 'test-model-filter.c',
c_args: test_cflags,
dependencies: test_ui_deps,
)
test_process_model = executable('test-process-model', 'test-process-model.c',
c_args: test_cflags,
dependencies: test_ui_deps,
)
test_zoom = executable('test-zoom',
['test-zoom.c', '../libsysprof-ui/sysprof-zoom-manager.c'],
c_args: test_cflags,
dependencies: test_ui_deps,
)
test_capture_view = executable('test-capture-view', 'test-capture-view.c',
c_args: test_cflags,
dependencies: test_ui_deps,
)
test('test-model-filter', test_model_filter, env: test_env)
test('test-zoom', test_zoom, env: test_env)
endif
endif

View File

@ -1,5 +1,3 @@
if get_option('enable_tools')
tools_deps = [
dependency('glib-2.0'),
libsysprof_capture_dep,
@ -28,7 +26,7 @@ sysprof_dump = executable('sysprof-dump', 'sysprof-dump.c',
install: false,
)
if get_option('with_sysprofd') == 'bundled' or get_option('libsysprof')
if get_option('sysprofd') == 'bundled' or get_option('libsysprof')
sysprof_profiler_ctl = executable('sysprof-profiler-ctl',
[ 'sysprof-profiler-ctl.c', ipc_profiler_src ],
dependencies: [ tools_deps, dependency('gio-unix-2.0', version: glib_req_version) ],
@ -42,5 +40,3 @@ list_threads = executable('list-threads', ['list-threads.c'],
c_args: tools_cflags,
install: false,
)
endif