feat (lib): add cpp.meson build #22

Merged
sisungo merged 1 commits from sisungo/semios-packages:mesonbuild into master 2026-06-12 13:15:40 +08:00
+19
View File
@@ -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