summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorMurphyZhao <[email protected]>2019-08-23 23:25:58 +0800
committerMurphyZhao <[email protected]>2019-08-23 23:28:25 +0800
commitb1efdefebb5586aa25a9fc475661af0055238106 (patch)
treec3d06f6285052396ae8d43b4863ace0723e9f3ae /tools
parent76f2be20589e4ac0eee3a6def677bda67a2ffb53 (diff)
[tools][fix] 修改 iar.py 中 iar 版本查找失败后的处理,目的是在出错后终止 scons 程序,以发现并修改错误;并在成功后打印 iar 版本,便于调试
Signed-off-by: MurphyZhao <[email protected]>
Diffstat (limited to 'tools')
-rw-r--r--tools/iar.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/iar.py b/tools/iar.py
index 18a3cb8328..23cb8e11ac 100644
--- a/tools/iar.py
+++ b/tools/iar.py
@@ -194,10 +194,12 @@ def IARVersion():
cmd = os.path.join(path, 'iccarm.exe')
else:
print('Error: get IAR version failed. Please update the IAR installation path in rtconfig.py!')
- return "0.0"
+ exit(-1)
child = subprocess.Popen([cmd, '--version'], stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
stdout, stderr = child.communicate()
# example stdout: IAR ANSI C/C++ Compiler V8.20.1.14183/W32 for ARM
- return re.search('[\d\.]+', stdout).group(0)
+ iar_version = re.search('[\d\.]+', stdout).group(0)
+ print("IAR version: %s" % iar_version)
+ return iar_version