-
Notifications
You must be signed in to change notification settings - Fork 78
/
setup.py
39 lines (31 loc) · 963 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
33
34
35
36
37
38
39
from setuptools import setup, Extension, Command
from sys import executable
class BenchmarkCommand(Command):
user_options = []
description = "Benchmark this package"
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
from subprocess import call, PIPE
call([executable, 'setup.py', 'build_ext', '--inplace'], stdout=PIPE)
call([executable, '-m', 'fastecdsa.benchmark'])
curvemath = Extension(
'fastecdsa.curvemath',
include_dirs=['src/'],
libraries=['gmp'],
sources=['src/curveMath.c', 'src/curve.c', 'src/point.c'],
extra_compile_args=['-O2']
)
_ecdsa = Extension(
'fastecdsa._ecdsa',
include_dirs=['src/'],
libraries=['gmp'],
sources=['src/_ecdsa.c', 'src/curveMath.c', 'src/curve.c', 'src/point.c'],
extra_compile_args=['-O2']
)
setup(
cmdclass={'benchmark': BenchmarkCommand},
ext_modules=[curvemath, _ecdsa],
)