[Mod] 更新binding的编译教程

This commit is contained in:
nanoric 2019-01-24 23:28:21 -04:00
parent 9e7e4185a7
commit 31b6e230b6
2 changed files with 27 additions and 5 deletions

16
binding/build.bat Normal file
View File

@ -0,0 +1,16 @@
@echo off
if "%VS150COMNTOOLS%"=="" (
echo Please run this batch file under "x64 Native Tools Command Prompt for VS 2017"
echo Read the doc!
exit 1
)
@echo on
set binding_dir=%~dp0
cd %binding_dir%
rmdir /S /Q build
mkdir build
cd build
cmake -G "Visual Studio 15 2017 Win64" ..
msbuild vnpy_binding.sln /p:Configuration=Release /p:Platform=x64

View File

@ -10,15 +10,21 @@
> 在安装CMake的时候必须勾选将CMake加入PATH > 在安装CMake的时候必须勾选将CMake加入PATH
> 在安装Visual Studio的时候必须勾选使用C++的桌面开发(Desktop Development with C++) > 在安装Visual Studio的时候必须勾选使用C++的桌面开发(Desktop Development with C++)
## 编译步骤 ## 一键编译
打开开始菜单-Visual Studio 2017-x64 Native Tools Command Prompt for VS 2017
将vnpy/binding/build.bat拖入弹出的控制台回车运行即可。
## 手动编译
确保你安装好了Python3CMake还有Visual Studio和C++编译环境,下载好[vnpy]并解压。 确保你安装好了Python3CMake还有Visual Studio和C++编译环境,下载好[vnpy]并解压。
打开开始菜单-Visual Studio 2017-x64 Native Tools Command Prompt for VS 2017 打开开始菜单-Visual Studio 2017-x64 Native Tools Command Prompt for VS 2017
在弹出的控制台中运行以下命令假设你解压到C:\vnpy下 在弹出的控制台中运行以下命令将vnpy解压目录改为你将vnpy解压到的目录
```bat ```bat
cd C:\vnpy cd vnpy解压目录
mkdir binding/build mkdir binding\build
cd binding/build cd binding\build
cmake -G "Visual Studio 15 2017 Win64" .. cmake -G "Visual Studio 15 2017 Win64" ..
msbuild vnpy_binding.sln /p:Configuration=Release /p:Platform=x64 msbuild vnpy_binding.sln /p:Configuration=Release /p:Platform=x64
``` ```