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.
This commit is contained in:
@ -230,7 +230,9 @@ if not fmt_dep.found() or get_option('use-embedded-fmt')
|
|||||||
compile_args: '-DFMT_HEADER_ONLY')
|
compile_args: '-DFMT_HEADER_ONLY')
|
||||||
endif
|
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)
|
cli11_dep = dependency('CLI11', version: '>=2.4', required:false)
|
||||||
if not cli11_dep.found() or get_option('use-embedded-cli11')
|
if not cli11_dep.found() or get_option('use-embedded-cli11')
|
||||||
message('using embedded CLI11')
|
message('using embedded CLI11')
|
||||||
|
|||||||
@ -25,6 +25,11 @@ option('use-embedded-fmt',
|
|||||||
value: false,
|
value: false,
|
||||||
description: 'Use the embedded fmt, even if system package is found')
|
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
|
# language detection
|
||||||
#
|
#
|
||||||
|
|||||||
@ -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
|
## 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
|
## 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-view.cc',
|
||||||
'mu-cmd.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') + '"'],
|
cpp_args: ['-DMU_SCRIPTS_DIR="'+ join_paths(datadir, 'mu', 'scripts') + '"'],
|
||||||
install: true)
|
install: true)
|
||||||
#
|
#
|
||||||
|
|||||||
@ -49,7 +49,11 @@
|
|||||||
#include "mu-options.hh"
|
#include "mu-options.hh"
|
||||||
#include "mu-script.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;
|
using namespace Mu;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user