[+] improve meson:setup
1. allow to pass mode;
This commit is contained in:
parent
3a01fc9e87
commit
f87de4d9bf
@ -5,7 +5,7 @@ project(
|
|||||||
).stdout().strip('\n'),
|
).stdout().strip('\n'),
|
||||||
# 'online.fxreader.uv',
|
# 'online.fxreader.uv',
|
||||||
# ['c', 'cpp'],
|
# ['c', 'cpp'],
|
||||||
version: '0.1.5.19',
|
version: '0.1.5.20',
|
||||||
# default_options: [
|
# default_options: [
|
||||||
# 'cpp_std=c++23',
|
# 'cpp_std=c++23',
|
||||||
# # 'prefer_static=true',
|
# # 'prefer_static=true',
|
||||||
|
@ -648,11 +648,15 @@ class CLI(abc.ABC):
|
|||||||
force: bool,
|
force: bool,
|
||||||
argv: Optional[list[str]] = None,
|
argv: Optional[list[str]] = None,
|
||||||
env: Optional[dict[str, str]] = None,
|
env: Optional[dict[str, str]] = None,
|
||||||
|
mode: Optional[Literal['meson', 'pyproject']] = None,
|
||||||
# third_party_roots: Optional[list[pathlib.Path]] = None,
|
# third_party_roots: Optional[list[pathlib.Path]] = None,
|
||||||
) -> None:
|
) -> None:
|
||||||
from . import cli_bootstrap
|
from . import cli_bootstrap
|
||||||
from .os import shutil_rmtree
|
from .os import shutil_rmtree
|
||||||
|
|
||||||
|
if mode is None:
|
||||||
|
mode = 'meson'
|
||||||
|
|
||||||
project = self.projects[project_name]
|
project = self.projects[project_name]
|
||||||
|
|
||||||
if argv is None:
|
if argv is None:
|
||||||
@ -668,9 +672,9 @@ class CLI(abc.ABC):
|
|||||||
logger.info(dict(env=env))
|
logger.info(dict(env=env))
|
||||||
|
|
||||||
if force:
|
if force:
|
||||||
if (project.build_dir / 'meson').exists():
|
if (project.build_dir / mode).exists():
|
||||||
logger.info(dict(action='removing build dir', path=project.build_dir / 'meson'))
|
logger.info(dict(action='removing build dir', path=project.build_dir / mode))
|
||||||
shutil.rmtree(project.build_dir / 'meson')
|
shutil.rmtree(project.build_dir / mode)
|
||||||
|
|
||||||
extra_args: list[str] = []
|
extra_args: list[str] = []
|
||||||
|
|
||||||
@ -692,8 +696,8 @@ class CLI(abc.ABC):
|
|||||||
'mesonbuild.mesonmain',
|
'mesonbuild.mesonmain',
|
||||||
'setup',
|
'setup',
|
||||||
str(project.source_dir),
|
str(project.source_dir),
|
||||||
str(project.build_dir / 'meson'),
|
str(project.build_dir / mode),
|
||||||
'-Dmodes=["meson"]',
|
'-Dmodes=["{}"]'.format(mode),
|
||||||
*extra_args,
|
*extra_args,
|
||||||
# '-Dpkgconfig.relocatable=true',
|
# '-Dpkgconfig.relocatable=true',
|
||||||
'-Dprefix=/',
|
'-Dprefix=/',
|
||||||
|
Loading…
Reference in New Issue
Block a user