From 0674af1e95e0eccad9140054c60c862febe1f3ab Mon Sep 17 00:00:00 2001 From: songsenand Date: Fri, 16 Feb 2024 07:26:56 +0800 Subject: [PATCH] build(build.py): config build cgal-binding --- build.py | 31 ++++++++----------------------- 1 file changed, 8 insertions(+), 23 deletions(-) diff --git a/build.py b/build.py index 2659df8..d9a9f6d 100644 --- a/build.py +++ b/build.py @@ -1,24 +1,9 @@ -from pybind11.setup_helpers import Pybind11Extension, build_ext +import warnings +import subprocess - -def build(setup_kwargs): - __version__ = "0.0.1" - - ext_modules = [ - Pybind11Extension( - "toydesigner-cgal", - sources=sorted(glob("tdcgal/*.cpp")), - define_macros=[("VERSION_INFO", __version__)], - include_dirs=["./cgal"], - ), - ] - - setup_kwargs.update( - { - "version": __version__, - "author": "songsenand", - "author_email": "songsenand@163.com", - "ext_modules": ext_modules, - "cmd_class": {"build_ext": build_ext}, - } - ) +res = subprocess.run(["python3", "setup.py", "build_ext", "--inplace"]) +if res.returncode != 0: + warnings.warn(res.stderr.decode()) + warnings.warn("Error building toydesigner-cgal") +elif res.returncode == 0: + print("Successfully built toydesigner-cgal")