1 Star 2 Fork 5

vn.py官方/vnpy_uft

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
setup.py 2.01 KB
一键复制 编辑 原始数据 按行查看 历史
vn.py 提交于 2024-10-10 20:48 . [Fix] 修复链接库名称问题
import platform
from setuptools import Extension, setup
def get_ext_modules() -> list:
"""
获取三方模块
Linux和Windows需要编译封装接口
Mac由于缺乏二进制库支持无法使用
"""
if platform.system() == "Linux":
extra_compile_flags = [
"-std=c++17",
"-O3",
"-Wno-delete-incomplete",
"-Wno-sign-compare",
]
libraries = ["HsFutuSystemInfo", "HSMdApi", "HSTradeApi", "infocertsdk", "ldptcpsdk", "smf_api", "t2sdk"]
extra_link_args = ["-lstdc++"]
runtime_library_dirs = ["$ORIGIN"]
elif platform.system() == "Windows":
libraries = ["HsFutuSystemInfo", "HSMdApi", "HSTradeApi", "t2sdk"]
extra_compile_flags = ["-O2", "-MT"]
extra_link_args = []
runtime_library_dirs = []
else:
return []
vnuftmd = Extension(
"vnpy_uft.api.vnuftmd",
[
"vnpy_uft/api/vnuft/vnuftmd/vnuftmd.cpp",
],
include_dirs=["vnpy_uft/api/include",
"vnpy_uft/api/vnuft"],
define_macros=[],
undef_macros=[],
library_dirs=["vnpy_uft/api/libs", "vnpy_uft/api"],
libraries=libraries,
extra_compile_args=extra_compile_flags,
extra_link_args=extra_link_args,
runtime_library_dirs=runtime_library_dirs,
depends=[],
language="cpp",
)
vnufttd = Extension(
"vnpy_uft.api.vnufttd",
[
"vnpy_uft/api/vnuft/vnufttd/vnufttd.cpp",
],
include_dirs=["vnpy_uft/api/include",
"vnpy_uft/api/vnuft"],
define_macros=[],
undef_macros=[],
library_dirs=["vnpy_uft/api/libs", "vnpy_uft/api"],
libraries=libraries,
extra_compile_args=extra_compile_flags,
extra_link_args=extra_link_args,
runtime_library_dirs=runtime_library_dirs,
depends=[],
language="cpp",
)
return [vnufttd, vnuftmd]
setup(
ext_modules=get_ext_modules(),
)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/vnpy/vnpy_uft.git
git@gitee.com:vnpy/vnpy_uft.git
vnpy
vnpy_uft
vnpy_uft
main

搜索帮助