Make it possible for users for select /Zi or /ZI over /Z7 when using MSVC (#18790)

Summary:
Fixes https://github.com/pytorch/pytorch/issues/18701.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/18790

Differential Revision: D14748195

Pulled By: ezyang

fbshipit-source-id: e50df1b5ca199a88d7b5ea3ea45d25d23cd31a27
This commit is contained in:
peter
2019-04-03 08:19:45 -07:00
committed by Facebook Github Bot
parent 06b7fe59f2
commit 5e33085f27
3 changed files with 38 additions and 27 deletions

View File

@ -149,6 +149,7 @@ def run_cmake(version,
cflags = os.getenv('CFLAGS', "") + " " + os.getenv('CPPFLAGS', "")
ldflags = os.getenv('LDFLAGS', "")
if IS_WINDOWS:
cmake_defines(cmake_args, MSVC_Z7_OVERRIDE=os.getenv('MSVC_Z7_OVERRIDE', "ON"))
cflags += " /EHa"
mkdir_p(install_dir)