From eeb1ce85665c89cc5aa90c3a5a162ce255db91cb Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Tue, 19 Nov 2019 16:43:49 +0100 Subject: [PATCH] bluetooth: build test program only when tests are enabled The manual test should only be built when tests are enabled since it links to the test library. Fixes: 05c7a7702277 ('meson: Add missing "nm-bt-test" helper program') https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/287 --- src/devices/bluetooth/meson.build | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/devices/bluetooth/meson.build b/src/devices/bluetooth/meson.build index 63c47bcba9..a77ad60d46 100644 --- a/src/devices/bluetooth/meson.build +++ b/src/devices/bluetooth/meson.build @@ -35,11 +35,13 @@ test( args: [libnm_device_plugin_bluetooth.full_path(), linker_script_devices], ) -test_unit = 'nm-bt-test' +if enable_tests + test_unit = 'nm-bt-test' -executable( - test_unit, - 'tests/' + test_unit + '.c', - dependencies: libnetwork_manager_test_dep, - c_args: test_c_flags, -) + executable( + test_unit, + 'tests/' + test_unit + '.c', + dependencies: libnetwork_manager_test_dep, + c_args: test_c_flags, + ) +endif