ENH: add a wrapper around msvc_setup_env to guarantee the function is called only...
authorcournape <cournape@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Thu, 19 Nov 2009 04:55:31 +0000 (04:55 +0000)
committercournape <cournape@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Thu, 19 Nov 2009 04:55:31 +0000 (04:55 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@4439 fdb21ef1-2011-0410-befe-b5e4ea1792b1

src/engine/SCons/Tool/MSCommon/vc.py

index c5f59361b79b7ba5e8e097390ad7aa3bf61dc49f..8d5dba854c1ca6c5c0c2a7f01863a30de2e37d68 100644 (file)
@@ -314,6 +314,16 @@ def get_host_target(env):
 
     return host_platform, target_platform
 
+def msvc_setup_env_once(env):
+    try:
+        has_run  = env["MSVC_SETUP_RUN"]
+    except KeyError:
+        has_run = False
+
+    if not has_run:
+        msvc_setup_env(env)
+        env["MSVC_SETUP_RUN"] = False
+
 def msvc_setup_env(env):
     debug('msvc_setup_env()')