diff options
| author | Dirk-Jan C. Binnema <djcb@djcbsoftware.nl> | 2025-07-19 10:41:10 +0300 |
|---|---|---|
| committer | Dirk-Jan C. Binnema <djcb@djcbsoftware.nl> | 2025-07-24 19:55:27 +0300 |
| commit | 4c2ce92a15dd67ff7131165aa878d2e460dd1da8 (patch) | |
| tree | b184c74810705e4473bd1d1fa326705819f1fbf9 | |
| parent | 33958cd0f75205b7c0b758c3d1ae2d24ebc9e63a (diff) | |
cli11: prefer system package if found
mu embeds a "vendored" version of libcl11 under thirdparty/; but it's
better to use the system-package if the user has one.
So, use the system package if found or user -Duse-embedded-cli11=true is
specified.
| -rw-r--r-- | meson.build | 4 | ||||
| -rw-r--r-- | meson_options.txt | 5 | ||||
| -rw-r--r-- | mu/meson.build | 5 | ||||
| -rw-r--r-- | mu/mu-options.cc | 6 | ||||
| -rw-r--r-- | thirdparty/cli11/CLI11.hpp (renamed from thirdparty/CLI11.hpp) | 0 |
5 files changed, 16 insertions, 4 deletions
diff --git a/meson.build b/meson.build index a372157..3ec8a5f 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 1ef09b0..fcffae7 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 28dd00e..ee2460d 100644 --- a/mu/meson.build +++ b/mu/meson.build @@ -1,4 +1,4 @@ -## Copyright (C) 2021-2023 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl> +## Copyright (C) 2021-2025 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl> ## ## 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 f9593a2..9161028 100644 --- a/mu/mu-options.cc +++ b/mu/mu-options.cc @@ -49,7 +49,11 @@ #include "mu-options.hh" #include "mu-script.hh" -#include <thirdparty/CLI11.hpp> +#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 index 8a5b4c5..8a5b4c5 100644 --- a/thirdparty/CLI11.hpp +++ b/thirdparty/cli11/CLI11.hpp |
