summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/Tool/msvc.py
diff options
context:
space:
mode:
authorGary Oberbrunner <garyo@oberbrunner.com>2011-04-24 21:32:20 (GMT)
committerGary Oberbrunner <garyo@oberbrunner.com>2011-04-24 21:32:20 (GMT)
commit479a07af42147d77f3bae4cbb32eae407fb9dc24 (patch)
tree71aea99f0013fe3365d718df212c67fd474dfc34 /src/engine/SCons/Tool/msvc.py
parenta61777f9fb10310e60a400fe2afe553b9878588a (diff)
downloadSCons-479a07af42147d77f3bae4cbb32eae407fb9dc24.zip
SCons-479a07af42147d77f3bae4cbb32eae407fb9dc24.tar.gz
SCons-479a07af42147d77f3bae4cbb32eae407fb9dc24.tar.bz2
Fix issue 2627: MSVC_BATCH=False should turn off batch, not turn it on.
Diffstat (limited to 'src/engine/SCons/Tool/msvc.py')
-rw-r--r--src/engine/SCons/Tool/msvc.py18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/engine/SCons/Tool/msvc.py b/src/engine/SCons/Tool/msvc.py
index 36b65ca..d42c257 100644
--- a/src/engine/SCons/Tool/msvc.py
+++ b/src/engine/SCons/Tool/msvc.py
@@ -140,8 +140,13 @@ def msvc_batch_key(action, env, target, source):
Returning None specifies that the specified target+source should not
be batched with other compilations.
"""
- b = env.subst('$MSVC_BATCH')
- if b in (None, '', '0'):
+
+ # Fixing MSVC_BATCH mode. Previous if did not work when MSVC_BATCH
+ # was set to False. This new version should work better.
+ # Note we need to do the env.subst so $MSVC_BATCH can be a reference to
+ # another construction variable, which is why we test for False and 0
+ # as strings.
+ if not 'MSVC_BATCH' in env or env.subst('$MSVC_BATCH') in ('0', 'False', '', None):
# We're not using batching; return no key.
return None
t = target[0]
@@ -161,8 +166,13 @@ def msvc_output_flag(target, source, env, for_signature):
we return an /Fo string that just specifies the first target's
directory (where the Visual C/C++ compiler will put the .obj files).
"""
- b = env.subst('$MSVC_BATCH')
- if b in (None, '', '0') or len(source) == 1:
+
+ # Fixing MSVC_BATCH mode. Previous if did not work when MSVC_BATCH
+ # was set to False. This new version should work better. Removed
+ # len(source)==1 as batch mode can compile only one file
+ # (and it also fixed problem with compiling only one changed file
+ # with batch mode enabled)
+ if not 'MSVC_BATCH' in env or env.subst('$MSVC_BATCH') in ('0', 'False', '', None):
return '/Fo$TARGET'
else:
# The Visual C/C++ compiler requires a \ at the end of the /Fo