mirror of
https://github.com/CLIUtils/CLI11.git
synced 2025-04-30 12:43:52 +00:00
Since Monterey 12.3, macOS removed python2.7 from it's base installation. This means that `python` is not longer a command by default (just `python3`), and the build for CLI11 fails. This PR moves to using `pymod.find_installation()` to handle this in a more general way. See https://mesonbuild.com/Python-module.html
25 lines
923 B
Meson
25 lines
923 B
Meson
# Because Meson does not allow outputs to be placed in subfolders, we must have
|
|
# meson.build here when generating the single file header so that it is placced
|
|
# in the correct location.
|
|
|
|
pymod = import('python')
|
|
prog_python = pymod.find_installation()
|
|
|
|
single_main_file = files('CLI11.hpp.in')
|
|
|
|
if use_single_header
|
|
single_header = custom_target(
|
|
'CLI11.hpp',
|
|
input: [files('../scripts/MakeSingleHeader.py'), cli11_headers, cli11_impl_headers],
|
|
output: 'CLI11.hpp',
|
|
command : [prog_python, '@INPUT@', '--main', single_main_file, '--output', '@OUTPUT@'],
|
|
depend_files: [single_main_file],
|
|
)
|
|
else
|
|
# the `declare_dependency` needs to have the single_header source as a source
|
|
# dependency, to ensure that the generator runs before any attempts to include
|
|
# the header happen. Adding an empty list is an idiomatic way to ensure the
|
|
# variable exists but does nothing
|
|
single_header = []
|
|
endif
|