diff options
author | Joseph Brill <48932340+jcbrill@users.noreply.github.com> | 2022-07-18 13:12:31 (GMT) |
---|---|---|
committer | Joseph Brill <48932340+jcbrill@users.noreply.github.com> | 2022-07-18 13:12:31 (GMT) |
commit | d6c4499f50573499f9c8c87742610e8d26be0f94 (patch) | |
tree | 1c996a6df4af1f4127c0f6d6bff8f55c4464d6ee /SCons/Tool | |
parent | 32bfd79a27f2c28f8b8feea396e1636c55fa0f28 (diff) | |
download | SCons-d6c4499f50573499f9c8c87742610e8d26be0f94.zip SCons-d6c4499f50573499f9c8c87742610e8d26be0f94.tar.gz SCons-d6c4499f50573499f9c8c87742610e8d26be0f94.tar.bz2 |
Minor tweaks for readability and consistency.
Diffstat (limited to 'SCons/Tool')
-rw-r--r-- | SCons/Tool/MSCommon/MSVC/ScriptArguments.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/SCons/Tool/MSCommon/MSVC/ScriptArguments.py b/SCons/Tool/MSCommon/MSVC/ScriptArguments.py index b4191de..57dbf9d 100644 --- a/SCons/Tool/MSCommon/MSVC/ScriptArguments.py +++ b/SCons/Tool/MSCommon/MSVC/ScriptArguments.py @@ -331,7 +331,7 @@ def _msvc_script_argument_sdk(env, msvc, toolset, platform_def, arglist): return sdk_version -def _msvc_script_default_sdk(env, msvc, platform_def, arglist): +def _msvc_script_default_sdk(env, msvc, platform_def, arglist, force_sdk=False): if msvc.vs_def.vc_buildtools_def.vc_version_numeric < VS2015.vc_buildtools_def.vc_version_numeric: return None @@ -347,8 +347,9 @@ def _msvc_script_default_sdk(env, msvc, platform_def, arglist): repr(msvc.version), repr(sdk_default), repr(platform_def.vc_platform) ) - argpair = (SortOrder.SDK, sdk_default) - arglist.append(argpair) + if force_sdk: + argpair = (SortOrder.SDK, sdk_default) + arglist.append(argpair) return sdk_default @@ -685,7 +686,7 @@ def _msvc_script_argument_toolset(env, msvc, vc_dir, arglist): return toolset_vcvars -def _msvc_script_default_toolset(env, msvc, vc_dir, arglist, force_toolset): +def _msvc_script_default_toolset(env, msvc, vc_dir, arglist, force_toolset=False): if msvc.vs_def.vc_buildtools_def.vc_version_numeric < VS2017.vc_buildtools_def.vc_version_numeric: return None @@ -917,6 +918,8 @@ def msvc_script_arguments(env, version, vc_dir, arg): if not toolset_version and not user_toolset: default_toolset = _msvc_script_default_toolset(env, msvc, vc_dir, arglist, _MSVC_FORCE_DEFAULT_TOOLSET) + if _MSVC_FORCE_DEFAULT_TOOLSET: + toolset_version = default_toolset else: default_toolset = None @@ -943,7 +946,7 @@ def msvc_script_arguments(env, version, vc_dir, arg): if _MSVC_FORCE_DEFAULT_SDK: if not sdk_version and not user_sdk: - sdk_version = _msvc_script_default_sdk(env, msvc, platform_def, arglist) + sdk_version = _msvc_script_default_sdk(env, msvc, platform_def, arglist, _MSVC_FORCE_DEFAULT_SDK) # MSVC_SPECTRE_LIBS @@ -964,7 +967,7 @@ def msvc_script_arguments(env, version, vc_dir, arg): arglist.sort() if arglist_reverse: arglist.reverse() - + arguments.extend([argpair[-1] for argpair in arglist]) argstr = ' '.join(arguments).strip() |