diff options
author | Joseph Brill <48932340+jcbrill@users.noreply.github.com> | 2022-06-21 15:22:29 (GMT) |
---|---|---|
committer | Joseph Brill <48932340+jcbrill@users.noreply.github.com> | 2022-06-21 15:22:29 (GMT) |
commit | a5938cce33f77237e45ad86a3f43e58f65ba74d3 (patch) | |
tree | 4d75012f3d5f87aa17f42c9a18ad2d0d08744cb9 /SCons/Tool | |
parent | ad7a59d1621d4154aeb51ba402f77aa18d65e21d (diff) | |
download | SCons-a5938cce33f77237e45ad86a3f43e58f65ba74d3.zip SCons-a5938cce33f77237e45ad86a3f43e58f65ba74d3.tar.gz SCons-a5938cce33f77237e45ad86a3f43e58f65ba74d3.tar.bz2 |
Move SCONS_CACHE_MSVC_FORCE_DEFAULTS environment variable query to MSCommon and set boolean if active.
Diffstat (limited to 'SCons/Tool')
-rw-r--r-- | SCons/Tool/MSCommon/MSVC/ScriptArguments.py | 18 | ||||
-rw-r--r-- | SCons/Tool/MSCommon/common.py | 5 |
2 files changed, 12 insertions, 11 deletions
diff --git a/SCons/Tool/MSCommon/MSVC/ScriptArguments.py b/SCons/Tool/MSCommon/MSVC/ScriptArguments.py index 2a94650..aa96946 100644 --- a/SCons/Tool/MSCommon/MSVC/ScriptArguments.py +++ b/SCons/Tool/MSCommon/MSVC/ScriptArguments.py @@ -34,7 +34,7 @@ from collections import ( ) from ..common import ( - CONFIG_CACHE, + CONFIG_CACHE_FORCE_DEFAULT_ARGUMENTS, debug, ) @@ -51,13 +51,6 @@ from . import Dispatcher Dispatcher.register_modulename(__name__) -# Force default SDK and toolset arguments in cache -_SCONS_CACHE_MSVC_FORCE_DEFAULTS = False -if CONFIG_CACHE: - # SCONS_CACHE_MSVC_FORCE_DEFAULTS is internal and not documented. - if os.environ.get('SCONS_CACHE_MSVC_FORCE_DEFAULTS') in Config.BOOLEAN_SYMBOLS[True]: - _SCONS_CACHE_MSVC_FORCE_DEFAULTS = True - # Script argument: boolean True _ARGUMENT_BOOLEAN_TRUE_LEGACY = (True, '1') # MSVC_UWP_APP _ARGUMENT_BOOLEAN_TRUE = (True,) @@ -118,9 +111,12 @@ def _msvc_force_default_toolset(force=True): _MSVC_FORCE_DEFAULT_TOOLSET = force debug('_MSVC_FORCE_DEFAULT_TOOLSET=%s', repr(force)) -if _SCONS_CACHE_MSVC_FORCE_DEFAULTS: - _msvc_force_default_sdk(True) - _msvc_force_default_toolset(True) +def msvc_force_default_arguments(force=True): + _msvc_force_default_sdk(force) + _msvc_force_default_toolset(force) + +if CONFIG_CACHE_FORCE_DEFAULT_ARGUMENTS: + msvc_force_default_arguments(force=True) # MSVC batch file arguments: # diff --git a/SCons/Tool/MSCommon/common.py b/SCons/Tool/MSCommon/common.py index c9f07f5..da8fd55 100644 --- a/SCons/Tool/MSCommon/common.py +++ b/SCons/Tool/MSCommon/common.py @@ -102,6 +102,11 @@ CONFIG_CACHE = os.environ.get('SCONS_CACHE_MSVC_CONFIG') if CONFIG_CACHE in ('1', 'true', 'True'): CONFIG_CACHE = os.path.join(os.path.expanduser('~'), 'scons_msvc_cache.json') +# SCONS_CACHE_MSVC_FORCE_DEFAULTS is internal-use so undocumented. +CONFIG_CACHE_FORCE_DEFAULT_ARGUMENTS = False +if CONFIG_CACHE: + if os.environ.get('SCONS_CACHE_MSVC_FORCE_DEFAULTS') in ('1', 'true', 'True'): + CONFIG_CACHE_FORCE_DEFAULT_ARGUMENTS = True def read_script_env_cache(): """ fetch cached msvc env vars if requested, else return empty dict """ |