MCPcopy Create free account
hub / github.com/boostorg/build / auto_detect_toolset_versions

Function auto_detect_toolset_versions

v2/tools/msvc.py:574–592  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

572# environment variables & default paths. Supports both native Windows and
573# Cygwin.
574def auto_detect_toolset_versions():
575 if on_windows() or on_cygwin():
576 for version in _known_versions:
577 versionVarName = '__version_{}_reg'.format(version.replace('.','_'))
578 if versionVarName in globals():
579 vc_path = None
580 for x in [ '', 'Wow6432Node\\' ]:
581 try:
582 with _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, 'SOFTWARE\\Microsoft\\{}{}'.format(x, globals()[versionVarName])) as reg_key:
583 vc_path = _winreg.QueryValueEx(reg_key, "ProductDir")[0]
584 except:
585 pass
586 if vc_path:
587 vc_path = os.path.join(vc_path,'bin')
588 register_configuration(version,os.path.normpath(vc_path))
589
590 for i in _known_versions:
591 if not i in __versions.all():
592 register_configuration(i,default_path(i))
593
594
595# Worker rule for toolset version configuration. Takes an explicit version id or

Callers 1

msvc.pyFile · 0.85

Calls 5

on_windowsFunction · 0.90
on_cygwinFunction · 0.85
register_configurationFunction · 0.85
default_pathFunction · 0.85
allMethod · 0.80

Tested by

no test coverage detected