-
Notifications
You must be signed in to change notification settings - Fork 42
Expand file tree
/
Copy pathsetup.py
More file actions
executable file
·34 lines (32 loc) · 1.02 KB
/
Copy pathsetup.py
File metadata and controls
executable file
·34 lines (32 loc) · 1.02 KB
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
#!/usr/bin/env python
import os
import sys
from setuptools import Extension, setup
if sys.platform == "win32":
extra_compile_args = ["/std:c11", "/experimental:c11atomics"]
# MSVC keeps __STDC_NO_ATOMICS__ defined even when its experimental
# C11 atomics support is enabled, so enable QuickJS atomics explicitly.
define_macros = [("CONFIG_ATOMICS", "1")]
elif sys.platform.startswith("linux"):
extra_compile_args = ["-std=c11"]
define_macros = [("_GNU_SOURCE", "1")]
else:
extra_compile_args = ["-std=c11"]
define_macros = []
setup(
ext_modules=[
Extension(
"dukpy._dukpy",
sources=[
os.path.join("src", "quickjs", "quickjs-amalgam.c"),
os.path.join("src", "_support.c"),
os.path.join("src", "dukpyjs.c"),
],
include_dirs=[
os.path.join(".", "src", "quickjs"),
],
extra_compile_args=extra_compile_args,
define_macros=define_macros,
)
],
)