-
Notifications
You must be signed in to change notification settings - Fork 6
/
setup.py
32 lines (29 loc) · 1.1 KB
/
setup.py
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
from setuptools import setup
from setuptools.command.build_ext import build_ext as _build_ext
from setuptools.extension import Extension
class build_ext(_build_ext):
def build_extension(self, ext):
for i, extra in enumerate(ext.extra_objects):
if isinstance(extra, Extension):
sources = sorted(extra.sources)
extra_args = extra.extra_compile_args or []
macros = extra.define_macros[:]
for undef in extra.undef_macros:
macros.append((undef,))
objects = self.compiler.compile(
sources,
output_dir=self.build_temp,
macros=macros,
include_dirs=extra.include_dirs,
debug=self.debug,
extra_postargs=extra_args,
depends=extra.depends,
)
ext.extra_objects[i] = objects[0]
return super().build_extension(ext)
setup(
cmdclass={'build_ext': build_ext},
cffi_modules=[
'./ada_url/ada_build.py:ffi_builder',
],
)