diff --git a/meson.build b/meson.build index a3721575..3ec8a5fc 100644 --- a/meson.build +++ b/meson.build @@ -230,7 +230,9 @@ if not fmt_dep.found() or get_option('use-embedded-fmt') compile_args: '-DFMT_HEADER_ONLY') endif -# use system's CLI11 if found, otherwise fall back to embedded version +# use system's CLI11 if found, otherwise fall back to embedded version. we can +# probably get away with a lower version, but want to have (roughly) the same in +# embedded / system. cli11_dep = dependency('CLI11', version: '>=2.4', required:false) if not cli11_dep.found() or get_option('use-embedded-cli11') message('using embedded CLI11') diff --git a/meson_options.txt b/meson_options.txt index 1ef09b0f..fcffae7c 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -25,6 +25,11 @@ option('use-embedded-fmt', value: false, description: 'Use the embedded fmt, even if system package is found') +option('use-embedded-cli11', + type: 'boolean', + value: false, + description: 'Use the embedded CLI11, even if system package is found') + # # language detection # diff --git a/mu/meson.build b/mu/meson.build index 28dd00ed..ee2460d5 100644 --- a/mu/meson.build +++ b/mu/meson.build @@ -1,4 +1,4 @@ -## Copyright (C) 2021-2023 Dirk-Jan C. Binnema +## Copyright (C) 2021-2025 Dirk-Jan C. Binnema ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -34,7 +34,8 @@ mu = executable( 'mu-cmd-view.cc', 'mu-cmd.cc' ], - dependencies: [ glib_dep, gmime_dep, lib_mu_dep, mu_scm_dep, thread_dep, config_h_dep ], + dependencies: [ glib_dep, gmime_dep, cli11_dep, + lib_mu_dep, mu_scm_dep, thread_dep, config_h_dep ], cpp_args: ['-DMU_SCRIPTS_DIR="'+ join_paths(datadir, 'mu', 'scripts') + '"'], install: true) # diff --git a/mu/mu-options.cc b/mu/mu-options.cc index f9593a2c..91610282 100644 --- a/mu/mu-options.cc +++ b/mu/mu-options.cc @@ -49,7 +49,11 @@ #include "mu-options.hh" #include "mu-script.hh" -#include +#ifdef USE_EMBEDDED_CLI11 +#include "CLI11.hpp" +#else +#include "CLI/CLI.hpp" +#endif using namespace Mu; diff --git a/thirdparty/CLI11.hpp b/thirdparty/cli11/CLI11.hpp similarity index 100% rename from thirdparty/CLI11.hpp rename to thirdparty/cli11/CLI11.hpp