[simulator][rtconfig.py] fix the problem of path cannot be find and cause failure

Some users' computer cannot find the path of VS and will cause failure. Just skip this step.
This commit is contained in:
Meco Man 2022-08-10 14:12:02 -04:00 committed by Man, Jianting (Meco)
parent 0ac8f72037
commit f290ff8754
1 changed files with 16 additions and 13 deletions

View File

@ -27,19 +27,22 @@ elif CROSS_TOOL == 'msvc':
CPU = 'win32' CPU = 'win32'
PLATFORM = 'cl' PLATFORM = 'cl'
EXEC_PATH = '' EXEC_PATH = ''
try:
vc_version = '' vc_version = ''
vc_versions = SCons.Tool.MSCommon.vc.get_installed_vcs() vc_versions = SCons.Tool.MSCommon.vc.get_installed_vcs()
if not vc_versions: if not vc_versions:
print("No vc version!") print("No vc version!")
exit(1) exit()
else: else:
vc_version = vc_versions[0] vc_version = vc_versions[0]
EXEC_PATH = SCons.Tool.MSCommon.vc.find_vc_pdir(vc_version) EXEC_PATH = SCons.Tool.MSCommon.vc.find_vc_pdir(vc_version)
if not EXEC_PATH: if not EXEC_PATH:
print('Installed VC %s failure!' % vc_version) print('Installed VC %s failure!' % vc_version)
exit(1) exit()
else: else:
print('Successfully installed VC %s, path:%s' % (vc_version, EXEC_PATH)) print('Successfully installed VC %s, path:%s' % (vc_version, EXEC_PATH))
except:
pass
else: else:
print("Simulator does not support this CROSS TOOL!") print("Simulator does not support this CROSS TOOL!")