From 31b6e230b665fe1a22c010fd869a3e502381b3a5 Mon Sep 17 00:00:00 2001 From: nanoric Date: Thu, 24 Jan 2019 23:28:21 -0400 Subject: [PATCH] =?UTF-8?q?[Mod]=20=E6=9B=B4=E6=96=B0binding=E7=9A=84?= =?UTF-8?q?=E7=BC=96=E8=AF=91=E6=95=99=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- binding/build.bat | 16 ++++++++++++++++ binding/doc/build.windows.md | 16 +++++++++++----- 2 files changed, 27 insertions(+), 5 deletions(-) create mode 100644 binding/build.bat diff --git a/binding/build.bat b/binding/build.bat new file mode 100644 index 00000000..8ce0d8ad --- /dev/null +++ b/binding/build.bat @@ -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 diff --git a/binding/doc/build.windows.md b/binding/doc/build.windows.md index c28989eb..8dc16f4b 100644 --- a/binding/doc/build.windows.md +++ b/binding/doc/build.windows.md @@ -10,15 +10,21 @@ > 在安装CMake的时候必须勾选将CMake加入PATH > 在安装Visual Studio的时候必须勾选使用C++的桌面开发(Desktop Development with C++) -## 编译步骤 +## 一键编译 + +打开开始菜单-Visual Studio 2017-x64 Native Tools Command Prompt for VS 2017 +将vnpy/binding/build.bat拖入弹出的控制台,回车运行即可。 + + +## 手动编译 确保你安装好了Python3,CMake还有Visual Studio和C++编译环境,下载好[vnpy]并解压。 打开开始菜单-Visual Studio 2017-x64 Native Tools Command Prompt for VS 2017 -在弹出的控制台中运行以下命令:(假设你解压到C:\vnpy下) +在弹出的控制台中运行以下命令(将vnpy解压目录改为你将vnpy解压到的目录): ```bat -cd C:\vnpy -mkdir binding/build -cd binding/build +cd vnpy解压目录 +mkdir binding\build +cd binding\build cmake -G "Visual Studio 15 2017 Win64" .. msbuild vnpy_binding.sln /p:Configuration=Release /p:Platform=x64 ```