-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathsetup.py
32 lines (22 loc) · 893 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
import sys
from setuptools import setup, Extension
srcs = ['QJS.c', "src/cutils.c","src/libregexp.c","src/libunicode.c","src/quickjs.c","src/quickjs-libc.c"]
extra_compile_args = ['-flto','-Wno-array-bounds', '-Wno-format-truncation','-w' ]
extra_link_args = ["-Wl,-Bstatic"]
# python setup.py build -f -c mingw32
# python setup.py bdist_wheel
if sys.platform == 'win32':
import distutils.cygwinccompiler
distutils.cygwinccompiler.get_msvcr = lambda: []
CONFIG_VERSION='\\"2020-01-19\\"'
else:
CONFIG_VERSION='\"2020-01-19\"'
extra_link_args = []
mod_qjs = Extension('qjs', srcs ,
define_macros=[('CONFIG_VERSION', CONFIG_VERSION), ('_GNU_SOURCE','')],
include_dirs = ['include'],
extra_compile_args=extra_compile_args,
extra_link_args = extra_link_args )
setup(name='qjs',
version='1.0',
ext_modules=[mod_qjs, ])