[+] extend tool.meson
1. allow to specify setup args for meson setup, when building mode=meson of pyproject.toml;
This commit is contained in:
parent
b46571b198
commit
4d10656e0a
@ -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.17+27.1',
|
version: '0.1.5.17+27.2',
|
||||||
# default_options: [
|
# default_options: [
|
||||||
# 'cpp_std=c++23',
|
# 'cpp_std=c++23',
|
||||||
# # 'prefer_static=true',
|
# # 'prefer_static=true',
|
||||||
|
@ -46,7 +46,8 @@ class PyProject:
|
|||||||
class Meson:
|
class Meson:
|
||||||
@dataclasses.dataclass
|
@dataclasses.dataclass
|
||||||
class Args:
|
class Args:
|
||||||
install: list[str]
|
install: Optional[list[str]] = None
|
||||||
|
setup: Optional[list[str]] = None
|
||||||
|
|
||||||
args: Args
|
args: Args
|
||||||
|
|
||||||
@ -541,6 +542,8 @@ class CLI(abc.ABC):
|
|||||||
env: Optional[dict[str, str]] = None,
|
env: Optional[dict[str, str]] = None,
|
||||||
# third_party_roots: Optional[list[pathlib.Path]] = None,
|
# third_party_roots: Optional[list[pathlib.Path]] = None,
|
||||||
) -> None:
|
) -> None:
|
||||||
|
from . import cli_bootstrap
|
||||||
|
|
||||||
project = self.projects[project_name]
|
project = self.projects[project_name]
|
||||||
|
|
||||||
if argv is None:
|
if argv is None:
|
||||||
@ -549,6 +552,10 @@ class CLI(abc.ABC):
|
|||||||
if env is None:
|
if env is None:
|
||||||
env = dict()
|
env = dict()
|
||||||
|
|
||||||
|
pyproject = cli_bootstrap.pyproject_load(project.source_dir / 'pyproject.toml')
|
||||||
|
|
||||||
|
pyproject_tool = pydantic.RootModel[PyProject.Tool].model_validate(pyproject.tool).root
|
||||||
|
|
||||||
logger.info(dict(env=env))
|
logger.info(dict(env=env))
|
||||||
|
|
||||||
if force:
|
if force:
|
||||||
@ -561,6 +568,9 @@ class CLI(abc.ABC):
|
|||||||
if len(self.third_party_roots) > 0:
|
if len(self.third_party_roots) > 0:
|
||||||
extra_args.extend(['-Dthird_party_roots=%s' % str(o.absolute()) for o in self.third_party_roots])
|
extra_args.extend(['-Dthird_party_roots=%s' % str(o.absolute()) for o in self.third_party_roots])
|
||||||
|
|
||||||
|
if pyproject_tool.meson and pyproject_tool.meson.args and pyproject_tool.meson.args.setup:
|
||||||
|
extra_args = pyproject_tool.meson.args.setup + extra_args
|
||||||
|
|
||||||
cmd = [
|
cmd = [
|
||||||
shutil_which(
|
shutil_which(
|
||||||
'meson',
|
'meson',
|
||||||
|
BIN
releases/whl/online_fxreader_pr34-0.1.5.17+27.2-py3-none-any.whl
(Stored with Git LFS)
Normal file
BIN
releases/whl/online_fxreader_pr34-0.1.5.17+27.2-py3-none-any.whl
(Stored with Git LFS)
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user