summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGary Oberbrunner <garyo@oberbrunner.com>2012-05-06 22:35:22 -0400
committerGary Oberbrunner <garyo@oberbrunner.com>2012-05-06 22:35:22 -0400
commit4ed4c0db27ab349cce3f0f6653bd6c2e61064734 (patch)
treefe69ac5dfa2a68142e855ef61941bbe275772b6d
parente95a2fd02fbae5abd2cb89119a4db4e625b23ad0 (diff)
downloadscons-4ed4c0db27ab349cce3f0f6653bd6c2e61064734.tar.gz
MSVC: show valid $TARGET_ARCH values when invalid arch passed in.
-rw-r--r--src/CHANGES.txt4
-rw-r--r--src/engine/SCons/Tool/MSCommon/vc.py3
-rw-r--r--test/MSVC/TARGET_ARCH.py13
3 files changed, 18 insertions, 2 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt
index 7747a3e5..d1ae455d 100644
--- a/src/CHANGES.txt
+++ b/src/CHANGES.txt
@@ -6,6 +6,10 @@
RELEASE 2.X.X -
+ From Gary Oberbrunner:
+ - Show valid Visual Studio architectures in error message
+ when user passes invalid arch.
+
From Alexey Petruchik:
- Support for Microsoft Visual Studio 11 (both using it
and generating MSVS11 solution files).
diff --git a/src/engine/SCons/Tool/MSCommon/vc.py b/src/engine/SCons/Tool/MSCommon/vc.py
index 66470873..91cae1c8 100644
--- a/src/engine/SCons/Tool/MSCommon/vc.py
+++ b/src/engine/SCons/Tool/MSCommon/vc.py
@@ -124,7 +124,8 @@ def get_host_target(env):
try:
target = _ARCH_TO_CANONICAL[target_platform.lower()]
except KeyError, e:
- raise ValueError("Unrecognized target architecture %s" % target_platform)
+ all_archs = str(_ARCH_TO_CANONICAL.keys())
+ raise ValueError("Unrecognized target architecture %s\n\tValid architectures: %s" % (target_platform, all_archs))
return (host, target,req_target_platform)
diff --git a/test/MSVC/TARGET_ARCH.py b/test/MSVC/TARGET_ARCH.py
index 963e2a5f..d6d8b43f 100644
--- a/test/MSVC/TARGET_ARCH.py
+++ b/test/MSVC/TARGET_ARCH.py
@@ -25,7 +25,7 @@
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
"""
-Test the ability to configure the $PCHCOM construction variable.
+Test the ability to configure the $TARGET_ARCH construction variable.
"""
import TestSCons
@@ -48,6 +48,17 @@ env_32 = Environment(tools=['default', 'msvc'],
test.run(arguments = ".")
+# test.pass_test()
+
+test.write('SConstruct', """
+env_xx = Environment(tools=['default', 'msvc'],
+ TARGET_ARCH = 'nosucharch')
+""" % locals())
+
+test.run(arguments = ".", status=2, stderr=None)
+test.must_contain_any_line(test.stderr(), "Unrecognized target architecture")
+test.must_contain_any_line(test.stderr(), "Valid architectures")
+
test.pass_test()
# Local Variables: