From 5186264852d242e0e5cadeef30d80fd0003f11dc Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Sat, 6 Apr 2024 10:36:18 +0300 Subject: [PATCH] utils: only build mu-tests-utils when tests are enabled This fixes a compilation failure. Fixes #2684. --- lib/utils/meson.build | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/lib/utils/meson.build b/lib/utils/meson.build index e8f3567dd..75c38ce3e 100644 --- a/lib/utils/meson.build +++ b/lib/utils/meson.build @@ -14,10 +14,9 @@ ## along with this program; if not, write to the Free Software Foundation, ## Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - thirdparty=join_paths('..', '..', 'thirdparty') -lib_mu_utils=static_library('mu-utils', [ +srcs = [ 'mu-command-handler.cc', 'mu-html-to-text.cc', 'mu-lang-detector.cc', @@ -25,10 +24,18 @@ lib_mu_utils=static_library('mu-utils', [ 'mu-option.cc', 'mu-readline.cc', 'mu-sexp.cc', - 'mu-test-utils.cc', 'mu-utils-file.cc', - 'mu-utils.cc' -], dependencies: [ + 'mu-utils.cc', +] + +if get_option('tests').enabled() + test_srcs = [ 'mu-test-utils.cc' ] +else + test_srcs = [] +endif + +lib_mu_utils=static_library('mu-utils', + [ srcs, test_srcs ], dependencies: [ glib_dep, gio_dep, gio_unix_dep,