-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup.py
50 lines (40 loc) · 1.33 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
# encoding:utf-8
import os
import sys
from setuptools import setup, find_packages, Extension
project_dir = os.path.join(os.path.dirname(__file__), "pyctp")
ctp_dir = os.path.abspath(os.path.join(project_dir, "ctp"))
header_dir = os.path.abspath(os.path.join(project_dir, "header"))
compile_args = []
extra_link_args = []
package_data = ["ctp/*.xml", "ctp/*.dtd"]
if sys.platform == "linux":
compile_args = ["-03", "-Wall"]
extra_link_args = ["-g"]
package_data.append("ctp/*.so")
elif sys.platform == "win32":
compile_args = ["/GR", "/EHsc"]
extra_link_args = []
package_data.append("ctp/*.dll")
common_args = {
"include_dirs": [ctp_dir, header_dir],
"library_dirs": [ctp_dir],
"language": "c++"
}
extensions = [
Extension(name="pyctp.md_api",
sources=["pyctp/md_api.cpp", "pyctp/api_struct.cpp", "pyctp/md_wrapper.cpp"],
extra_compile_args=compile_args,
extra_link_args=extra_link_args,
libraries=["thostmduserapi"],
**common_args)
]
setup(name="python CTP api",
version="6.3.6",
author="winton.wang",
author_email="winton@quant.vc",
description="This is CTP wrapper python interface",
include_package_data=True,
packages=find_packages(),
package_data={"": package_data},
ext_modules=extensions)