-
Notifications
You must be signed in to change notification settings - Fork 4
/
setup.py
66 lines (56 loc) · 1.79 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import platform
from setuptools import Extension, setup
def get_ext_modules() -> list:
"""
获取三方模块
Linux需要编译封装接口
Windows直接使用预编译的pyd即可
Mac由于缺乏二进制库支持无法使用
"""
if platform.system() != "Linux":
return []
compiler_flags = [
"-std=c++17",
"-O3",
"-Wno-delete-incomplete", "-Wno-sign-compare",
]
extra_link_args = ["-lstdc++"]
runtime_library_dirs = ["$ORIGIN"]
vnksgoldmd = Extension(
"vnpy_ksgold.api.vnksgoldmd",
[
"vnpy_ksgold/api/vnksgold/vnksgoldmd/vnksgoldmd.cpp",
],
include_dirs=["vnpy_ksgold/api/include",
"vnpy_ksgold/api/vnksgold"],
define_macros=[],
undef_macros=[],
library_dirs=["vnpy_ksgold/api/libs", "vnpy_ksgold/api"],
libraries=["ksgoldquotmarketdataapi", "ksgoldtraderapi"],
extra_compile_args=compiler_flags,
extra_link_args=extra_link_args,
runtime_library_dirs=runtime_library_dirs,
depends=[],
language="cpp",
)
vnksgoldtd = Extension(
"vnpy_ksgold.api.vnksgoldtd",
[
"vnpy_ksgold/api/vnksgold/vnksgoldtd/vnksgoldtd.cpp",
],
include_dirs=["vnpy_ksgold/api/include",
"vnpy_ksgold/api/vnksgold"],
define_macros=[],
undef_macros=[],
library_dirs=["vnpy_ksgold/api/libs", "vnpy_ksgold/api"],
libraries=["ksgoldquotmarketdataapi", "ksgoldtraderapi"],
extra_compile_args=compiler_flags,
extra_link_args=extra_link_args,
runtime_library_dirs=runtime_library_dirs,
depends=[],
language="cpp",
)
return [vnksgoldtd, vnksgoldmd]
setup(
ext_modules=get_ext_modules(),
)