diff --git a/lib/cpp.py b/lib/cpp.py index 6c58745..40e745d 100644 --- a/lib/cpp.py +++ b/lib/cpp.py @@ -51,6 +51,25 @@ def ninja_install(rem: list[str] = [], chdir: bool = True): os.chdir(os.environ["DESTDIR"]) +def meson_setup(rem: list[str] = []): + subprocess.run(["meson", "setup", "_meson_build"] + rem, check=True) + + +def meson_compile(rem: list[str] = []): + subprocess.run(["meson", "compile", "-C", "_meson_build"] + rem, check=True) + + +def meson_install(rem: list[str] | None = None, chdir: bool = True): + default_rem = ["--destdir", f"{os.getcwd()}/../cpp_install"] + if not rem: + os.makedirs("../cpp_install", exist_ok=True) + subprocess.run( + ["meson", "install", "-C", "_meson_build"] + (rem or default_rem), check=True + ) + if chdir: + os.chdir("../cpp_install") + + def _do_auto_pack(pc: pkgcomposer.PkgComposer, srcdir: str, dstdir: str, filter): if not os.path.exists(srcdir): return