Hi Juraj, On Fri, Mar 3, 2023 at 11:25 AM Juraj Linkeš <juraj.lin...@pantheon.tech> wrote: > +class MesonArgs(object): > + """ > + Aggregate the arguments needed to build DPDK: > + default_library: Default library type, Meson allows "shared", "static" > and "both". > + Defaults to None, in which case the argument won't be used. > + Keyword arguments: The arguments found in meson_options.txt in root DPDK > directory. > + Do not use -D with them, for example: > + meson_args = MesonArgs(enable_kmods=True). > + """ > + > + _default_library: str > + > + def __init__(self, default_library: str | None = None, **dpdk_args: str > | bool): > + self._default_library = ( > + f"--default-library={default_library}" if default_library else "" > + ) > + self._dpdk_args = " ".join( > + ( > + f"-D{dpdk_arg_name}={dpdk_arg_value}" > + for dpdk_arg_name, dpdk_arg_value in dpdk_args.items() > + ) > + )
I am missing something here. Afair, meson accepts the -Ddefault_library form. Why do we need this special case? > + > + def __str__(self) -> str: > + return " ".join(f"{self._default_library} {self._dpdk_args}".split()) > -- > 2.30.2 > -- David Marchand