ENH: handle MSVS_VERSION additionally to MSVC_VERSION, but raise deprecation warnings...
authorcournape <cournape@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Thu, 19 Nov 2009 05:02:55 +0000 (05:02 +0000)
committercournape <cournape@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Thu, 19 Nov 2009 05:02:55 +0000 (05:02 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@4450 fdb21ef1-2011-0410-befe-b5e4ea1792b1

src/engine/SCons/Script/Main.py
src/engine/SCons/Tool/MSCommon/vc.py
src/engine/SCons/Warnings.py

index d2f672a5085ca0100a84e81f3c4b6fc5e535753c..6aba90f243529ddca363aab16573a610694be3af 100644 (file)
@@ -776,6 +776,7 @@ def _main(parser):
                          SCons.Warnings.MisleadingKeywordsWarning,
                          SCons.Warnings.ReservedVariableWarning,
                          SCons.Warnings.StackSizeWarning,
+                         SCons.Warnings.VisualVersionMismatch,
                        ]
 
     for warning in default_warnings:
index 48af5a3108aef6b7d709b6c420407db153b3818e..623c511657fc23fb7857cb648a4e35c81409fddd 100644 (file)
@@ -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)
index c783d1ed79af90c5b0bca1e7ae77424172c1d879..797ff41b6d7eb998c9e6b7081864f9b095d87702 100644 (file)
@@ -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