From 5630e1680fd7094d5801fce3061ec4a04aa6f7ea Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Mon, 3 Jun 2019 12:26:25 -0700 Subject: [PATCH] build: add -Dlibsysprof option This gets us closer to being able to only build the capture static library --- meson_options.txt | 3 +++ src/libsysprof-ui/meson.build | 2 +- src/libsysprof/meson.build | 4 ++++ src/sysprof/meson.build | 2 +- 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/meson_options.txt b/meson_options.txt index fd0c9d10..f30c7834 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -3,6 +3,9 @@ # server scenarios. option('enable_gtk', type: 'boolean') +# Disable libsysprof/ui (in situations you only want sysprof-capture) +option('libsysprof', type: 'boolean') + # Optionally compile sysprofd, which is needed to get elevated privileges. # You only really want to ignore this if you are running from a container # and are talking to a host daemon. Also, if you're compiling for something diff --git a/src/libsysprof-ui/meson.build b/src/libsysprof-ui/meson.build index f25f5f25..fc9c9479 100644 --- a/src/libsysprof-ui/meson.build +++ b/src/libsysprof-ui/meson.build @@ -1,4 +1,4 @@ -if get_option('enable_gtk') +if get_option('enable_gtk') and get_option('libsysprof') libsysprof_ui_public_sources = [ 'sysprof-aid.c', diff --git a/src/libsysprof/meson.build b/src/libsysprof/meson.build index 3b9679c8..1d89e7d6 100644 --- a/src/libsysprof/meson.build +++ b/src/libsysprof/meson.build @@ -1,3 +1,5 @@ +if get_option('libsysprof') + libsysprof_c_args = [ '-DSYSPROF_COMPILATION' ] libsysprof_public_sources = [ @@ -127,3 +129,5 @@ pkgconfig.generate( ) install_headers(libsysprof_public_headers, subdir: sysprof_header_subdir) + +endif diff --git a/src/sysprof/meson.build b/src/sysprof/meson.build index 1595ed43..6a291608 100644 --- a/src/sysprof/meson.build +++ b/src/sysprof/meson.build @@ -1,4 +1,4 @@ -if get_option('enable_gtk') +if get_option('enable_gtk') and get_option('libsysprof') sysprof_sources = [ 'sysprof.c',