-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup.py
32 lines (27 loc) · 950 Bytes
/
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 distutils.core import setup
from distutils.extension import Extension
from Cython.Build import cythonize
from distutils.command.build_ext import build_ext
from distutils.sysconfig import customize_compiler
class BuildExt(build_ext):
def build_extensions(self):
customize_compiler(self.compiler)
for args in ["-Wstrict-prototypes"]:
try:
self.compiler.compiler_so.remove(args)
except (AttributeError, ValueError):
pass
build_ext.build_extensions(self)
extensions = [
Extension("cy_aho_corasick", ["cy_aho_corasick.pyx"],
include_dirs=["./src"],
libraries=[],
library_dirs=[],
language="c++",
extra_compile_args=['-std=c++11', '-Ofast', '-march=native', '-fno-wrapv'])
]
setup(
name="cy_aho_corasick",
ext_modules=cythonize(extensions),
cmdclass={'build_ext': BuildExt}
)