Commit cac230c9 authored by ale's avatar ale

Build Python extension before the Python module

Since swig generates a .py file, the build_ext step needs to run
before the build one.
parent 0b0ad240
import os
from distutils.core import setup, Extension
from distutils.command.build_py import build_py as _build_py
SRCDIR = os.getenv('SRCDIR', '.')
BUILDDIR = os.getenv('BUILDDIR', SRCDIR)
......@@ -17,7 +18,16 @@ if not os.getenv('BUILD_MODULE'):
])
libraries = []
# Run the build_ext command first (swig generates a Python file).
class build_py(_build_py):
def run(self):
self.run_command("build_ext")
return _build_py.run(self)
setup(name='sso',
cmdclass={'build_py': build_py},
ext_modules=[Extension('sso._sso_c', ext_sources,
swig_opts=['-c++', '-modern', '-I' + top_srcdir],
include_dirs=[top_srcdir],
......
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