代码拉取完成,页面将自动刷新
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(),
)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。