1 Star 3 Fork 2

vn.py官方/vnpy_mini

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
setup.py 1.90 KB
一键复制 编辑 原始数据 按行查看 历史
noranhe 提交于 2022-07-14 15:47 . [Add] 增加Python版本限制
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",
]
extra_link_args = ["-lstdc++"]
runtime_library_dirs = ["$ORIGIN"]
elif platform.system() == "Windows":
extra_compile_flags = ["-O2", "-MT"]
extra_link_args = []
runtime_library_dirs = []
else:
return []
vnminimd = Extension(
"vnpy_mini.api.vnminimd",
[
"vnpy_mini/api/vnmini/vnminimd/vnminimd.cpp",
],
include_dirs=["vnpy_mini/api/include",
"vnpy_mini/api/vnmini"],
define_macros=[],
undef_macros=[],
library_dirs=["vnpy_mini/api/libs", "vnpy_mini/api"],
libraries=["thostmduserapi", "thosttraderapi"],
extra_compile_args=extra_compile_flags,
extra_link_args=extra_link_args,
runtime_library_dirs=runtime_library_dirs,
depends=[],
language="cpp",
)
vnminitd = Extension(
"vnpy_mini.api.vnminitd",
[
"vnpy_mini/api/vnmini/vnminitd/vnminitd.cpp",
],
include_dirs=["vnpy_mini/api/include",
"vnpy_mini/api/vnmini"],
define_macros=[],
undef_macros=[],
library_dirs=["vnpy_mini/api/libs", "vnpy_mini/api"],
libraries=["thostmduserapi", "thosttraderapi"],
extra_compile_args=extra_compile_flags,
extra_link_args=extra_link_args,
runtime_library_dirs=runtime_library_dirs,
depends=[],
language="cpp",
)
return [vnminitd, vnminimd]
setup(
ext_modules=get_ext_modules(),
)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/vnpy/vnpy_mini.git
git@gitee.com:vnpy/vnpy_mini.git
vnpy
vnpy_mini
vnpy_mini
main

搜索帮助