summaryrefslogtreecommitdiff
path: root/bsp/simulator/rtconfig.py
diff options
context:
space:
mode:
authorbuxiasen <[email protected]>2020-05-12 16:15:35 +0800
committerbuxiasen <[email protected]>2020-05-12 16:15:35 +0800
commit188befc78e7cc68f81f1b2b8cbd5ed1807c019c3 (patch)
tree895bba81b82103a29d36dbfe697a326678914798 /bsp/simulator/rtconfig.py
parent49f366e9474c0713cbe6e096eec6aedcb70197a9 (diff)
simulator add support for msvc auto find path
Diffstat (limited to 'bsp/simulator/rtconfig.py')
-rwxr-xr-xbsp/simulator/rtconfig.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/bsp/simulator/rtconfig.py b/bsp/simulator/rtconfig.py
index 8fcbcebd00..d5c74ba42a 100755
--- a/bsp/simulator/rtconfig.py
+++ b/bsp/simulator/rtconfig.py
@@ -1,11 +1,12 @@
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)