diff options
author | William Deegan <bill@baddogconsulting.com> | 2010-02-05 20:42:07 (GMT) |
---|---|---|
committer | William Deegan <bill@baddogconsulting.com> | 2010-02-05 20:42:07 (GMT) |
commit | ca579c1efd252ea31d3c65b516fdc41d1237dafe (patch) | |
tree | ccfc56f4bc05b1fb86273cce6d762680f5e8d477 /src/engine | |
parent | 4196f33e72b416118022ccb9c7a11d9408800685 (diff) | |
download | SCons-ca579c1efd252ea31d3c65b516fdc41d1237dafe.zip SCons-ca579c1efd252ea31d3c65b516fdc41d1237dafe.tar.gz SCons-ca579c1efd252ea31d3c65b516fdc41d1237dafe.tar.bz2 |
Gracefully handle not finding the VC and/or SDK setup batch scripts.
Diffstat (limited to 'src/engine')
-rw-r--r-- | src/engine/SCons/Tool/MSCommon/vc.py | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/engine/SCons/Tool/MSCommon/vc.py b/src/engine/SCons/Tool/MSCommon/vc.py index efe77fa..5350216 100644 --- a/src/engine/SCons/Tool/MSCommon/vc.py +++ b/src/engine/SCons/Tool/MSCommon/vc.py @@ -362,14 +362,22 @@ def msvc_setup_env(env): SCons.Warnings.warn(SCons.Warnings.VisualCMissingWarning, warn_msg) arg = _HOST_TARGET_ARCH_TO_BAT_ARCH[host_target] debug('use_script 2 %s, args:%s\n' % (repr(vc_script), arg)) - try: - d = script_env(vc_script, args=arg) - except BatchFileExecutionError, e: - #print "Trying:%s"%sdk_script - debug('use_script 3: failed running %s: %s: Error:%s'%(repr(vc_script),arg,e)) + if vc_script: + try: + d = script_env(vc_script, args=arg) + except BatchFileExecutionError, e: + debug('use_script 3: failed running VC script %s: %s: Error:%s'%(repr(vc_script),arg,e)) + vc_script=None + if not vc_script and sdk_script: debug('use_script 4: trying sdk script: %s %s'%(sdk_script,arg)) - d = script_env(sdk_script,args=[]) - #return None + try: + d = script_env(sdk_script,args=[]) + except BatchFileExecutionError,e: + debug('use_script 5: failed running SDK script %s: Error:%s'%(repr(sdk_script),e)) + return None + else: + debug('use_script 6: Neither VC script nor SDK script found') + return None else: debug('MSVC_USE_SCRIPT set to False') |