diff --git a/lib/wpipc/meson.build b/lib/wpipc/meson.build index b0c5f666..a423ff0d 100644 --- a/lib/wpipc/meson.build +++ b/lib/wpipc/meson.build @@ -1,3 +1,8 @@ +if get_option('wpipc').disabled() + wpipc_dep = disabler() + subdir_done() +endif + wpipc_lib_sources = files( 'utils.c', 'protocol.c', diff --git a/meson_options.txt b/meson_options.txt index 20d82b08..3bad2fd6 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -19,3 +19,5 @@ option('systemd-system-unit-dir', option('systemd-user-unit-dir', type : 'string', description : 'Directory for user systemd units') +option('wpipc', type : 'feature', value : 'disabled', + description: 'Build the wpipc library and module-ipc') diff --git a/modules/meson.build b/modules/meson.build index 1d55f872..e4f79a5b 100644 --- a/modules/meson.build +++ b/modules/meson.build @@ -177,13 +177,15 @@ shared_library( dependencies : [wp_dep, pipewire_dep, mathlib], ) -shared_library( - 'wireplumber-module-ipc', - [ - 'module-ipc.c', - ], - c_args : [common_c_args, '-DG_LOG_DOMAIN="m-ipc"'], - install : true, - install_dir : wireplumber_module_dir, - dependencies : [wp_dep, pipewire_dep, wpipc_dep], -) +if wpipc_dep.found() + shared_library( + 'wireplumber-module-ipc', + [ + 'module-ipc.c', + ], + c_args : [common_c_args, '-DG_LOG_DOMAIN="m-ipc"'], + install : true, + install_dir : wireplumber_module_dir, + dependencies : [wp_dep, pipewire_dep, wpipc_dep], + ) +endif diff --git a/tests/examples/meson.build b/tests/examples/meson.build index 135289eb..798fc045 100644 --- a/tests/examples/meson.build +++ b/tests/examples/meson.build @@ -9,13 +9,15 @@ executable('audiotestsrc-play', dependencies : [giounix_dep, wp_dep, pipewire_dep], ) -executable('wpipc-client', - 'wpipc-client.c', - c_args : [ - '-D_GNU_SOURCE', - '-DG_LOG_USE_STRUCTURED', - '-DG_LOG_DOMAIN="wpipc-client"', - ], - install: false, - dependencies : [wpipc_dep], -) +if wpipc_dep.found() + executable('wpipc-client', + 'wpipc-client.c', + c_args : [ + '-D_GNU_SOURCE', + '-DG_LOG_USE_STRUCTURED', + '-DG_LOG_DOMAIN="wpipc-client"', + ], + install: false, + dependencies : [wpipc_dep], + ) +endif diff --git a/tests/meson.build b/tests/meson.build index 9ec06c99..74591b62 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -1,5 +1,5 @@ subdir('wp') subdir('wplua') -subdir('wpipc') +subdir('wpipc', if_found: wpipc_dep) subdir('modules') subdir('examples')