summaryrefslogtreecommitdiffstats
path: root/SCons/Tool
diff options
context:
space:
mode:
authorJoseph Brill <48932340+jcbrill@users.noreply.github.com>2022-06-21 12:59:21 (GMT)
committerJoseph Brill <48932340+jcbrill@users.noreply.github.com>2022-06-21 12:59:21 (GMT)
commit5dd220bf7d625771acc7f7ca476275795029b560 (patch)
treed846d5a5243d165278b77e38a0f2d1ab7d54d76b /SCons/Tool
parentdd328cff200935a7f570396f06b93a3da82278d7 (diff)
downloadSCons-5dd220bf7d625771acc7f7ca476275795029b560.zip
SCons-5dd220bf7d625771acc7f7ca476275795029b560.tar.gz
SCons-5dd220bf7d625771acc7f7ca476275795029b560.tar.bz2
Add internal, undocumented SCONS_CACHE_MSVC_FORCE_DEFAULTS environment variable to force default SDK and toolset arguments.
Diffstat (limited to 'SCons/Tool')
-rw-r--r--SCons/Tool/MSCommon/MSVC/ScriptArguments.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/SCons/Tool/MSCommon/MSVC/ScriptArguments.py b/SCons/Tool/MSCommon/MSVC/ScriptArguments.py
index a64d9f4..8bef3f5 100644
--- a/SCons/Tool/MSCommon/MSVC/ScriptArguments.py
+++ b/SCons/Tool/MSCommon/MSVC/ScriptArguments.py
@@ -34,6 +34,7 @@ from collections import (
)
from ..common import (
+ CONFIG_CACHE,
debug,
)
@@ -50,6 +51,13 @@ 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
+
# MSVC_UWP_APP argument: boolean True
_UWP_ARGUMENT_BOOLEAN_TRUE = (True, '1')
@@ -99,6 +107,20 @@ _MSVC_FORCE_DEFAULT_SDK = False
# Force default toolset argument
_MSVC_FORCE_DEFAULT_TOOLSET = False
+def _msvc_force_default_sdk(force=True):
+ global _MSVC_FORCE_DEFAULT_SDK
+ _MSVC_FORCE_DEFAULT_SDK = force
+ debug('_MSVC_FORCE_DEFAULT_SDK=%s', repr(force))
+
+def _msvc_force_default_toolset(force=True):
+ global _MSVC_FORCE_DEFAULT_TOOLSET
+ _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)
+
# MSVC batch file arguments:
#
# VS2022: UWP, SDK, TOOLSET, SPECTRE