From a22ee640760c5d248bf69ab908e9e5ac50ce186b Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Thu, 11 Jun 2020 10:28:01 -0600 Subject: Tweak MSCommon README a bit [ci skip] Formatting fiddles Signed-off-by: Mats Wichmann --- SCons/Tool/MSCommon/README | 103 ++++++++++++++++++++++----------------------- 1 file changed, 51 insertions(+), 52 deletions(-) diff --git a/SCons/Tool/MSCommon/README b/SCons/Tool/MSCommon/README index b3675cc..2268651 100644 --- a/SCons/Tool/MSCommon/README +++ b/SCons/Tool/MSCommon/README @@ -17,39 +17,37 @@ batch that starts with a call to msvc_setup_env(). Internal to MSCommon/vc.py: -+ MSCommon/vc.py:msvc_exists -| vcs = cached_get_installed_vcs(env) -| returns True if vcs > 0 -| -+-> MSCommon/vc.py:cached_get_installed_vcs ++ MSCommon/vc.py:msvc_exists: +| vcs = cached_get_installed_vcs(env) +| returns True if vcs > 0 +| ++-> MSCommon/vc.py:cached_get_installed_vcs: | checks global if we've run previously, if so return it | populate the global from -> get_installed_vcs(env) | - +-> MSCommon/vc.py:get_installed_vcs + +-> MSCommon/vc.py:get_installed_vcs: | loop through "known" versions of msvc, granularity is maj.min | check for product dir -> find_vc_pdir(env, ver) | - +-> MSCommon/vc.py:find_vc_pdir - | From the msvc-version to pdir mapping dict, get reg key base and value - | If value is none -> find_vc_pdir_vswhere(ver, env) + +-> MSCommon/vc.py:find_vc_pdir: + | From the msvc-version to pdir mapping dict, get reg key base and value + | If value is none -> find_vc_pdir_vswhere(ver, env) | - +-> MSCommon/vc.py:find_vc_pdir_vswhere - | From the vc-version to VS-version mapping table get string - | Figure out where vswhere is -> msvc_find_vswhere() - | Use subprocess to call vswhere, return first line of match + +-> MSCommon/vc.py:find_vc_pdir_vswhere: + | From the vc-version to VS-version mapping table get string + | Figure out where vswhere is -> msvc_find_vswhere() + | Use subprocess to call vswhere, return first line of match / - | Else get product directory from registry - | Note: 14.2, 14.1, 14.1Exp are the ones which will use vswhere + | else get product directory from registry (<= 14.0) / + | if we found one -> _check_cl_exists_in_vc_dir(env, pdir, ver) | - | if we found one -> _check_cl_exists_in_vc_dir(env, pdir, ver) - | - +-> MSCommon/vc.py:_check_cl_exists_in_vc_dir - | Figure out host/target pair - | If version > 14.0 get specific version by looking in - | pdir + Auxiliary/Build/Microsoft/VCToolsVersion/default.txt - | look for pdir + Tools/MSVC/{specver}/bin/host/target/cl.exe - | if 14.0 or less, "do older stuff" + +-> MSCommon/vc.py:_check_cl_exists_in_vc_dir: + | Figure out host/target pair + | if version > 14.0 get specific version by looking in + | pdir + Auxiliary/Build/Microsoft/VCToolsVersion/default.txt + | look for pdir + Tools/MSVC/{specver}/bin/host/target/cl.exe + | if 14.0 or less, "do older stuff" All of this just got us a yes-no answer on whether /some/ msvc version exists, but does populate __INSTALLED_VCS_RUN with all of the top-level @@ -64,45 +62,46 @@ Externally: Internally: -+ MSCommon/vc.py:msvc_setup_env_once -| checks for environment flag MSVC_SETUP_RUN -| if not, -> msvc_setup_env(env) and set flag ++ MSCommon/vc.py:msvc_setup_env_once: +| checks for environment flag MSVC_SETUP_RUN +| if not, -> msvc_setup_env(env) and set flag | -+-+ MSCommon/vc.py:msvc_setup_env - | set ver from -> get_default_version(env) ++-+ MSCommon/vc.py:msvc_setup_env: + | set ver from -> get_default_version(env) | - +-+ MSCommon/vc.py:get_default_version - | if no version specified in env.MSVC_VERSION: - | return first entry from -> cached_get_installed_vcs(env) - | else - | return requested version + +-+ MSCommon/vc.py:get_default_version: + | if no version specified in env.MSVC_VERSION: + | return first entry from -> cached_get_installed_vcs(env) + | else return requested version / - | get script from MSVC_USE_SCRIPT if set to a filename - | -> script_env(script) + | get script from MSVC_USE_SCRIPT if set to a filename + | -> script_env(script) | - +-+ MSCommon/vc.py:script_env - | return (possibly cached) script variables matching script arg + +-+ MSCommon/vc.py:script_env: + | return (possibly cached) script variables matching script arg / - | else - | -> msvc_find_valid_batch_script(env, version) + | else -> msvc_find_valid_batch_script(env, version) | - +-+ MSCommon/vc.py:msvc_find_valid_batch_script - | Build a list of plausible target values, and loop through - | look for host + target -> find_batch_file(env, ver, host, target) + +-+ MSCommon/vc.py:msvc_find_valid_batch_script: + | Build a list of plausible target values, and loop through + | look for host + target -> find_batch_file(env, ver, host, target) | - +-+ MSCommon/vc.py:find_batch_file - | call -> find_vc_pdir - | use the return to construct a version-biased batfile path, check + +-+ MSCommon/vc.py:find_batch_file: + | call -> find_vc_pdir (see above) + | use the return to construct a version-biased batfile path, check / - | if not found, try sdk scripts (unknown if this is still useful) + | if not found, try sdk scripts (unknown if this is still useful) Problems: -- As documented for MSVC_VERSION, compilers can only be requested - if versions are from the set in _VCVER, so 14.1 but not 14.16.27023 +- For VS >= 2017, VS and VS are not 1:1, there can be many VC for one VS +- For vswhere-ready versions, detection does not proceed beyond the + product level ("2019") into individual "features" (individual msvc) +- As documented for MSVC_VERSION, compilers can only be requested if versions + are from the set in _VCVER, so 14.1 but not 14.16 or 14.16.27023 - Information found in the first pass (msvs_exists) isn't really available anywhere except the cached version list, since we just - return true/fails -- For vswhere-ready versions, detection does not proceed beyond the - product level ("VS 2019") into individual "features" (i.e. specific - msvc install underneath it). + return true/false. +- Since msvc_exists chain of calls does not look at version, we + can proceed to compiler setup if *any* msvc was found, even if the + one requested wasn't found. -- cgit v0.12