summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernard Xiong <[email protected]>2019-08-26 19:09:18 +0800
committerGitHub <[email protected]>2019-08-26 19:09:18 +0800
commit40bb254ccd4a65e526ec9a7c0e8610161b58440c (patch)
treea1db3ddd6d9c09b2510133b10838c54cd7139bb1
parent6f8ea1dac99f3b44fde5132b722462cc40ad7fe8 (diff)
parent9b9175dca6ced17494338bf0e0dbd02d12cb0f5f (diff)
Merge pull request #2999 from murphyzhao/tools-iar-fix
[tools][fix] 修改 iar.py 中 iar 版本查找失败后的处理
-rw-r--r--tools/iar.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/tools/iar.py b/tools/iar.py
index 18a3cb8328..a0028128e3 100644
--- a/tools/iar.py
+++ b/tools/iar.py
@@ -27,6 +27,8 @@ import sys
import string
import utils
+from SCons.Script import *
+
import xml.etree.ElementTree as etree
from xml.etree.ElementTree import SubElement
from utils import _make_path_relative
@@ -194,10 +196,13 @@ 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)
+ if GetOption('verbose'):
+ print("IAR version: %s" % iar_version)
+ return iar_version