| | import setuptools |
| | import platform |
| |
|
| | from distutils.command.build_ext import build_ext |
| |
|
| | with open("README.md", "r") as fh: |
| | long_description = fh.read() |
| |
|
| | |
| | class get_pybind_include(object): |
| | """Helper class to determine the pybind11 include path |
| | The purpose of this class is to postpone importing pybind11 |
| | until it is actually installed, so that the ``get_include()`` |
| | method can be invoked. """ |
| |
|
| | def __init__(self, user=False, pep517=False): |
| | self.user = user |
| | self.pep517 = pep517 |
| |
|
| | def __str__(self): |
| | import os |
| | import pybind11 |
| |
|
| | interpreter_include_path = pybind11.get_include(self.user) |
| |
|
| | if self.pep517: |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | return os.path.abspath( |
| | os.path.join( |
| | os.path.dirname(pybind11.__file__), |
| | "..", |
| | "..", |
| | "..", |
| | "..", |
| | "include", |
| | os.path.basename(interpreter_include_path), |
| | ) |
| | ) |
| | else: |
| | return interpreter_include_path |
| |
|
| |
|
| | |
| | copt = {"unix": ["-std=c++11"], "gcc": ["-std=c++11"], "clang": ["std=c++11"]} |
| | |
| |
|
| | |
| | |
| |
|
| | |
| | class build_ext_subclass(build_ext): |
| | def build_extensions(self): |
| | c = self.compiler.compiler_type |
| | if c in copt: |
| | for e in self.extensions: |
| | e.extra_compile_args = copt[c] |
| |
|
| | |
| | |
| | |
| | build_ext.build_extensions(self) |
| |
|
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| | |
| | m = setuptools.Extension( |
| | "tinyobjloader", |
| | |
| | |
| | sources=["bindings.cc", "tiny_obj_loader.cc"], |
| | include_dirs=[ |
| | |
| | |
| | "..", |
| | |
| | |
| | get_pybind_include(), |
| | get_pybind_include(user=True), |
| | |
| | |
| | get_pybind_include(pep517=True), |
| | ], |
| | language="c++", |
| | ) |
| |
|
| |
|
| | setuptools.setup( |
| | name="tinyobjloader", |
| | version="2.0.0rc9", |
| | description="Tiny but powerful Wavefront OBJ loader", |
| | long_description=long_description, |
| | long_description_content_type="text/markdown", |
| | author="Syoyo Fujita", |
| | author_email="syoyo@lighttransport.com", |
| | url="https://github.com/tinyobjloader/tinyobjloader", |
| | project_urls={ |
| | "Issue Tracker": "https://github.com/tinyobjloader/tinyobjloader/issues", |
| | }, |
| | classifiers=[ |
| | "Development Status :: 5 - Production/Stable", |
| | "Intended Audience :: Developers", |
| | "Intended Audience :: Science/Research", |
| | "Intended Audience :: Manufacturing", |
| | "Topic :: Artistic Software", |
| | "Topic :: Multimedia :: Graphics :: 3D Modeling", |
| | "Topic :: Scientific/Engineering :: Visualization", |
| | "License :: OSI Approved :: MIT License", |
| | "License :: OSI Approved :: ISC License (ISCL)", |
| | "Operating System :: OS Independent", |
| | "Programming Language :: Python :: 3", |
| | ], |
| | packages=setuptools.find_packages(), |
| | ext_modules=[m], |
| | cmdclass={"build_ext": build_ext_subclass}, |
| | ) |
| |
|