From c0dc7bb922e1fb5945dced32b44c6a831bb33811 Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Mon, 29 Sep 2014 19:13:18 +0000 Subject: [PATCH] [SCons] Setting 'msvc_version' implies 'toolchain=msvc' --- SConstruct | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/SConstruct b/SConstruct index 121b1d10c..038f84030 100644 --- a/SConstruct +++ b/SConstruct @@ -131,16 +131,22 @@ if os.name == 'nt': ('target_arch', """Target architecture. The default is the same architecture as the installed version of Python.""", - target_arch), - EnumVariable( - 'toolchain', - """The preferred compiler toolchain.""", - defaultToolchain, ('msvc', 'mingw', 'intel'))]) + target_arch)]) opts.AddVariables(*windows_compiler_options) pickCompilerEnv = Environment() opts.Update(pickCompilerEnv) + if pickCompilerEnv['msvc_version']: + defaultToolchain = 'msvc' + + windows_compiler_options.append(EnumVariable( + 'toolchain', + """The preferred compiler toolchain.""", + defaultToolchain, ('msvc', 'mingw', 'intel'))) + opts.AddVariables(windows_compiler_options[-1]) + opts.Update(pickCompilerEnv) + if pickCompilerEnv['toolchain'] == 'msvc': toolchain = ['default'] if pickCompilerEnv['msvc_version']: