summaryrefslogtreecommitdiff
path: root/ext/pybind11/setup.py
diff options
context:
space:
mode:
authorJason Lowe-Power <jason@lowepower.com>2017-11-17 17:02:05 -0800
committerJason Lowe-Power <jason@lowepower.com>2017-12-14 00:27:59 +0000
commitf07d5069d86e31ecf195664850f79fb00c445bd3 (patch)
treef54ac06896fa828f873d199a0e9b25bd94911c79 /ext/pybind11/setup.py
parent3f64b374c49491f18dc2ca538ed8c8597e4aac83 (diff)
downloadgem5-f07d5069d86e31ecf195664850f79fb00c445bd3.tar.xz
ext: Upgrade PyBind11 to version 2.2.1
This upgrade is necessary for pybind to build with GCC 7.2. We still need to add the patch for stl.h. MSC_FULL_VER change is no longer needed. See https://gem5-review.googlesource.com/c/public/gem5/+/2230 Change-Id: I806729217d022070583994c2dfcaa74476aef30f Signed-off-by: Jason Lowe-Power <jason@lowepower.com> Reviewed-on: https://gem5-review.googlesource.com/5801 Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Diffstat (limited to 'ext/pybind11/setup.py')
-rw-r--r--ext/pybind11/setup.py30
1 files changed, 27 insertions, 3 deletions
diff --git a/ext/pybind11/setup.py b/ext/pybind11/setup.py
index 0cf4e47ce..b76120573 100644
--- a/ext/pybind11/setup.py
+++ b/ext/pybind11/setup.py
@@ -3,6 +3,7 @@
# Setup script for PyPI; use CMakeFile.txt to build extension modules
from setuptools import setup
+from distutils.command.install_headers import install_headers
from pybind11 import __version__
import os
@@ -12,16 +13,23 @@ if os.environ.get('PYBIND11_USE_CMAKE'):
headers = []
else:
headers = [
+ 'include/pybind11/detail/class.h',
+ 'include/pybind11/detail/common.h',
+ 'include/pybind11/detail/descr.h',
+ 'include/pybind11/detail/init.h',
+ 'include/pybind11/detail/internals.h',
+ 'include/pybind11/detail/typeid.h',
'include/pybind11/attr.h',
+ 'include/pybind11/buffer_info.h',
'include/pybind11/cast.h',
'include/pybind11/chrono.h',
- 'include/pybind11/class_support.h',
'include/pybind11/common.h',
'include/pybind11/complex.h',
- 'include/pybind11/descr.h',
'include/pybind11/eigen.h',
+ 'include/pybind11/embed.h',
'include/pybind11/eval.h',
'include/pybind11/functional.h',
+ 'include/pybind11/iostream.h',
'include/pybind11/numpy.h',
'include/pybind11/operators.h',
'include/pybind11/options.h',
@@ -29,9 +37,24 @@ else:
'include/pybind11/pytypes.h',
'include/pybind11/stl.h',
'include/pybind11/stl_bind.h',
- 'include/pybind11/typeid.h'
]
+
+class InstallHeaders(install_headers):
+ """Use custom header installer because the default one flattens subdirectories"""
+ def run(self):
+ if not self.distribution.headers:
+ return
+
+ for header in self.distribution.headers:
+ subdir = os.path.dirname(os.path.relpath(header, 'include/pybind11'))
+ install_dir = os.path.join(self.install_dir, subdir)
+ self.mkpath(install_dir)
+
+ (out, _) = self.copy_file(header, install_dir)
+ self.outfiles.append(out)
+
+
setup(
name='pybind11',
version=__version__,
@@ -43,6 +66,7 @@ setup(
packages=['pybind11'],
license='BSD',
headers=headers,
+ cmdclass=dict(install_headers=InstallHeaders),
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',