From 5afce747f142f6df6a264ab368c99f47050d9984 Mon Sep 17 00:00:00 2001 From: Sam James Date: Sat, 25 Jan 2025 16:05:20 +0000 Subject: [PATCH] meson: fix build with libnethogs disabled Fix `meson.build:43:19: ERROR: Unknown variable "libnethogs".`. While src/ has this correct, the top-level meson.build wasn't right. --- meson.build | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/meson.build b/meson.build index 16e61b4..8537718 100644 --- a/meson.build +++ b/meson.build @@ -38,9 +38,11 @@ subdir('src') ############################# ## Pkgconfig definition ## ############################# -pkgconfig = import('pkgconfig') -pkgconfig_install_dir = join_paths(get_option('libdir'), 'pkgconfig') -pkgconfig.generate(libnethogs, - requires: ['libpcap'], - version: meson.project_version() - ) +if get_option('enable-libnethogs').enabled() + pkgconfig = import('pkgconfig') + pkgconfig_install_dir = join_paths(get_option('libdir'), 'pkgconfig') + pkgconfig.generate(libnethogs, + requires: ['libpcap'], + version: meson.project_version() + ) +endif