Skip to content

Commit

Permalink
[Mod] 更新安装脚本文件
Browse files Browse the repository at this point in the history
  • Loading branch information
vnpy committed Dec 20, 2021
1 parent cdc34c8 commit 011b757
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 69 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Expand Up @@ -29,7 +29,7 @@
*.pyc
dist/
build/
vnpy_ctp.egg-info/
vnpy_sec.egg-info/
__pycache__/

# Visual Studio
Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
@@ -1 +1 @@
recursive-include vnpy_ctp *.dll *.so *.pyd *.h *.cpp
recursive-include vnpy_sec *.dll *.so *.pyd *.h *.cpp
4 changes: 2 additions & 2 deletions setup.cfg
Expand Up @@ -5,7 +5,7 @@ url = https://www.vnpy.com
license = MIT
author = Xiaoyou Chen
author_email = xiaoyou.chen@mail.vnpy.com
description = CTP gateway for vn.py quant trading framework.
description = XSpeed ETF option gateway for vn.py quant trading framework.
long_description = file: README.md
long_description_content_type = text/markdown
keywords =
Expand All @@ -14,7 +14,7 @@ keywords =
investment
trading
algotrading
ctp
sec
classifiers =
Development Status :: 5 - Production/Stable
Operating System :: Microsoft :: Windows
Expand Down
67 changes: 2 additions & 65 deletions setup.py
@@ -1,66 +1,3 @@
import platform
from setuptools import setup

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"]

vnctpmd = Extension(
"vnpy_ctp.api.vnctpmd",
[
"vnpy_ctp/api/vnctp/vnctpmd/vnctpmd.cpp",
],
include_dirs=["vnpy_ctp/api/include",
"vnpy_ctp/api/vnctp"],
define_macros=[],
undef_macros=[],
library_dirs=["vnpy_ctp/api/libs", "vnpy_ctp/api"],
libraries=["thostmduserapi_se", "thosttraderapi_se"],
extra_compile_args=compiler_flags,
extra_link_args=extra_link_args,
runtime_library_dirs=runtime_library_dirs,
depends=[],
language="cpp",
)

vnctptd = Extension(
"vnpy_ctp.api.vnctptd",
[
"vnpy_ctp/api/vnctp/vnctptd/vnctptd.cpp",
],
include_dirs=["vnpy_ctp/api/include",
"vnpy_ctp/api/vnctp"],
define_macros=[],
undef_macros=[],
library_dirs=["vnpy_ctp/api/libs", "vnpy_ctp/api"],
libraries=["thostmduserapi_se", "thosttraderapi_se"],
extra_compile_args=compiler_flags,
extra_link_args=extra_link_args,
runtime_library_dirs=runtime_library_dirs,
depends=[],
language="cpp",
)

return [vnctptd, vnctpmd]


setup(
ext_modules=get_ext_modules(),
)
setup()

0 comments on commit 011b757

Please sign in to comment.