From: cournape Date: Thu, 19 Nov 2009 04:55:31 +0000 (+0000) Subject: ENH: add a wrapper around msvc_setup_env to guarantee the function is called only... X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=a5d7b5486b99f909ed0b598fb2d697e4724e14d5;p=scons.git ENH: add a wrapper around msvc_setup_env to guarantee the function is called only once. git-svn-id: http://scons.tigris.org/svn/scons/trunk@4439 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- diff --git a/src/engine/SCons/Tool/MSCommon/vc.py b/src/engine/SCons/Tool/MSCommon/vc.py index c5f59361..8d5dba85 100644 --- a/src/engine/SCons/Tool/MSCommon/vc.py +++ b/src/engine/SCons/Tool/MSCommon/vc.py @@ -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()')