1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
|
From: =?utf-8?q?Timo_R=C3=B6hling?= <timo@gaussglocke.de>
Date: Fri, 13 Nov 2020 16:54:36 +0100
Subject: Use Pybind11 extension class
---
python/setup.py | 19 ++++++-------------
1 file changed, 6 insertions(+), 13 deletions(-)
diff --git a/python/setup.py b/python/setup.py
index d7aa0ca..1ce56d2 100644
--- a/python/setup.py
+++ b/python/setup.py
@@ -1,5 +1,6 @@
import setuptools
import platform
+from pybind11.setup_helpers import Pybind11Extension
with open("README.md", "r") as fh:
long_description = fh.read()
@@ -59,26 +60,18 @@ ext_link_args = []
# ext_link_args.append("-mmacosx-version-min=10.9")
# `tiny_obj_loader.cc` contains implementation of tiny_obj_loader.
-m = setuptools.Extension(
+m = Pybind11Extension(
"tinyobjloader",
- extra_compile_args=ext_compile_args,
- extra_link_args=ext_link_args,
sources=["bindings.cc", "tiny_obj_loader.cc"],
include_dirs=[
- # Support `build_ext` finding tinyobjloader (without first running
- # `sdist`).
"..",
- # Support `build_ext` finding pybind 11 (provided it's permanently
- # installed).
- get_pybind_include(),
- get_pybind_include(user=True),
- # Support building from a source distribution finding pybind11 from
- # a PEP 517 temporary install.
- get_pybind_include(pep517=True),
],
- language="c++",
)
+try:
+ m.extra_compile_args.remove("-g0")
+except ValueError:
+ pass
setuptools.setup(
name="tinyobjloader",
|