Commit 8f9e5619 authored by Kirill Smelkov's avatar Kirill Smelkov

pyx.build: Expose build_ext as public API

E.g. wendelin.core amends build_ext class and so it needs a way to
import it.
parent 8c2ac5e9
...@@ -66,11 +66,11 @@ def _findpkg(pkgname): # -> _PyPkg ...@@ -66,11 +66,11 @@ def _findpkg(pkgname): # -> _PyPkg
return pypkg return pypkg
# _build_ext amends setuptools_dso.build_ext to allow combining C and C++ # build_ext amends setuptools_dso.build_ext to allow combining C and C++
# sources in one extension without hitting `error: invalid argument # sources in one extension without hitting `error: invalid argument
# '-std=c++11' not allowed with 'C'`. # '-std=c++11' not allowed with 'C'`.
_dso_build_ext = setuptools_dso.build_ext _dso_build_ext = setuptools_dso.build_ext
class _build_ext(_dso_build_ext): class build_ext(_dso_build_ext):
def build_extension(self, ext): def build_extension(self, ext):
# wrap _compiler <src> -> <obj> with our code # wrap _compiler <src> -> <obj> with our code
_compile = self.compiler._compile _compile = self.compiler._compile
...@@ -114,7 +114,7 @@ def setup(**kw): ...@@ -114,7 +114,7 @@ def setup(**kw):
# temporarily inject our code there. # temporarily inject our code there.
_ = setuptools_dso.build_ext _ = setuptools_dso.build_ext
try: try:
setuptools_dso.build_ext = _build_ext setuptools_dso.build_ext = build_ext
setuptools_dso.setup(**kw) setuptools_dso.setup(**kw)
finally: finally:
setuptools_dso.build_ext = _ setuptools_dso.build_ext = _
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment