diff --git a/examples/meson.build b/examples/meson.build index 71a036a4..4cef7d15 100644 --- a/examples/meson.build +++ b/examples/meson.build @@ -1,3 +1,7 @@ +if get_option('enable_examples') + app = executable('example-app', 'app.c', dependencies: [dependency('glib-2.0'), libsysprof_capture_dep], ) + +endif diff --git a/meson_options.txt b/meson_options.txt index 623945c7..10f90fb1 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -32,3 +32,15 @@ option('help', type: 'boolean') # Disable use of libunwind option('libunwind', type: 'boolean') + +# Optionally disable the tools (this is mostly only useful for building only +# libsysprof-capture as a subproject) +option('enable_tools', type: 'boolean') + +# Optionally disable the tests (this is mostly only useful for building only +# libsysprof-capture as a subproject) +option('enable_tests', type: 'boolean') + +# Optionally disable the examples (this is mostly only useful for building only +# libsysprof-capture as a subproject) +option('enable_examples', type: 'boolean') diff --git a/src/tests/meson.build b/src/tests/meson.build index b46d6eb1..e2c1d65a 100644 --- a/src/tests/meson.build +++ b/src/tests/meson.build @@ -1,3 +1,5 @@ +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()), @@ -147,3 +149,4 @@ if get_option('enable_gtk') endif endif +endif diff --git a/src/tools/meson.build b/src/tools/meson.build index 97a242dd..6b49511d 100644 --- a/src/tools/meson.build +++ b/src/tools/meson.build @@ -1,3 +1,5 @@ +if get_option('enable_tools') + tools_deps = [ dependency('glib-2.0'), libsysprof_capture_dep, @@ -42,3 +44,5 @@ list_threads = executable('list-threads', ['list-threads.c'], c_args: tools_cflags, install: false, ) + +endif