未验证 提交 7544b401 编写于 作者: mysterywolf's avatar mysterywolf 提交者: GitHub

Merge pull request #53 from jasonbu/master

simulator add support for msvc auto find path
import os
import SCons.Tool.MSCommon.vc
# toolchains options
ARCH='sim'
#CROSS_TOOL='msvc' or 'gcc' or 'mingw'
#'msvc' and 'mingw' are both for windows
# 'gcc' is for linux
CROSS_TOOL='mingw'
CROSS_TOOL='msvc'
if os.getenv('RTT_CC'):
CROSS_TOOL = os.getenv('RTT_CC')
......@@ -26,6 +27,20 @@ elif CROSS_TOOL == 'msvc':
CPU = 'win32'
PLATFORM = 'cl'
EXEC_PATH = ''
vc_version = ''
vc_versions = SCons.Tool.MSCommon.vc.get_installed_vcs()
print(vc_versions)
if not vc_versions:
print("no vc version")
exit(1)
else:
vc_version = vc_versions[0]
EXEC_PATH = SCons.Tool.MSCommon.vc.find_vc_pdir(vc_version)
if not EXEC_PATH:
print('find_vs_dir(): no installed VC %s' % vc_version)
else:
print('find_vs_dir(): installed VC %s, path:%s' % (vc_version, EXEC_PATH))
else:
print("bad CROSS TOOL!")
exit(1)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册