From fcf801f06167b420fc24af52e5ddcae87f8ce13f Mon Sep 17 00:00:00 2001
From: Fei Sun <feisun@fb.com>
Date: Wed, 24 Oct 2018 12:21:36 -0700
Subject: [PATCH] Support building binary on windows machines

Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/13059

Reviewed By: llyfacebook

Differential Revision: D10560147

Pulled By: sf-wind

fbshipit-source-id: c8f38b30c9acdf6ae494e56a5876fd4493696e5d
---
 scripts/build_windows.bat | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/scripts/build_windows.bat b/scripts/build_windows.bat
index 281d20a8d6926..ea605c2cfc57d 100644
--- a/scripts/build_windows.bat
+++ b/scripts/build_windows.bat
@@ -10,6 +10,10 @@ setlocal
 SET ORIGINAL_DIR=%cd%
 SET CAFFE2_ROOT=%~dp0%..
 
+if NOT DEFINED BUILD_BINARY (
+  set BUILD_BINARY=OFF
+)
+
 if NOT DEFINED CAFFE2_STATIC_LINK_CUDA (
   set CAFFE2_STATIC_LINK_CUDA=OFF
 )
@@ -60,6 +64,7 @@ cd %CAFFE2_ROOT%\build
 cmake .. ^
   -G%CMAKE_GENERATOR% ^
   -DBUILD_TEST=OFF ^
+  -DBUILD_BINARY=%BUILD_BINARY% ^
   -DCMAKE_BUILD_TYPE=%CMAKE_BUILD_TYPE% ^
   -DCAFFE2_STATIC_LINK_CUDA=%CAFFE2_STATIC_LINK_CUDA% ^
   -DUSE_CUDA=%USE_CUDA% ^