From 0fc0eef5963b589f58c3ae66216d082e9e4aa832 Mon Sep 17 00:00:00 2001 From: cournape Date: Thu, 19 Nov 2009 05:02:55 +0000 Subject: [PATCH] ENH: handle MSVS_VERSION additionally to MSVC_VERSION, but raise deprecation warnings if used. git-svn-id: http://scons.tigris.org/svn/scons/trunk@4450 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- src/engine/SCons/Script/Main.py | 1 + src/engine/SCons/Tool/MSCommon/vc.py | 16 ++++++++++++++++ src/engine/SCons/Warnings.py | 5 +++++ 3 files changed, 22 insertions(+) diff --git a/src/engine/SCons/Script/Main.py b/src/engine/SCons/Script/Main.py index d2f672a5..6aba90f2 100644 --- a/src/engine/SCons/Script/Main.py +++ b/src/engine/SCons/Script/Main.py @@ -776,6 +776,7 @@ def _main(parser): SCons.Warnings.MisleadingKeywordsWarning, SCons.Warnings.ReservedVariableWarning, SCons.Warnings.StackSizeWarning, + SCons.Warnings.VisualVersionMismatch, ] for warning in default_warnings: diff --git a/src/engine/SCons/Tool/MSCommon/vc.py b/src/engine/SCons/Tool/MSCommon/vc.py index 48af5a31..623c5116 100644 --- a/src/engine/SCons/Tool/MSCommon/vc.py +++ b/src/engine/SCons/Tool/MSCommon/vc.py @@ -168,6 +168,22 @@ def get_default_version(env): debug('get_default_version()') msvc_version = env.get('MSVC_VERSION') + msvs_version = env.get('MSVS_VERSION') + + if msvs_version and not msvc_version: + SCons.Warnings.warn( + SCons.Warnings.DeprecatedWarning, + "MSVS_VERSION is deprecated: please use MSVC_VERSION instead ") + return msvs_version + elif msvc_version and msvs_version: + if not msvc_version == msvs_version: + SCons.Warnings.warn( + SCons.Warnings.VisualVersionMismatch, + "Requested msvc version (%s) and msvs version (%s) do " \ + "not match: please use MSVC_VERSION only to request a " \ + "visual studio version, MSVS_VERSION is deprecated" \ + % (msvc_version, msvs_version)) + return msvs_version if not msvc_version: installed_vcs = get_installed_vcs() debug('installed_vcs:%s' % installed_vcs) diff --git a/src/engine/SCons/Warnings.py b/src/engine/SCons/Warnings.py index c783d1ed..797ff41b 100644 --- a/src/engine/SCons/Warnings.py +++ b/src/engine/SCons/Warnings.py @@ -118,6 +118,11 @@ class TaskmasterNeedsExecuteWarning(FutureDeprecatedWarning): class VisualCMissingWarning(Warning): pass +# Used when MSVC_VERSION and MSVS_VERSION do not point to the +# same version (MSVS_VERSION is deprecated) +class VisualVersionMismatch(Warning): + pass + class VisualStudioMissingWarning(Warning): pass -- 2.26.2