From b1efdefebb5586aa25a9fc475661af0055238106 Mon Sep 17 00:00:00 2001 From: MurphyZhao Date: Fri, 23 Aug 2019 23:25:58 +0800 Subject: [PATCH 1/2] =?UTF-8?q?[tools][fix]=20=E4=BF=AE=E6=94=B9=20iar.py?= =?UTF-8?q?=20=E4=B8=AD=20iar=20=E7=89=88=E6=9C=AC=E6=9F=A5=E6=89=BE?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E5=90=8E=E7=9A=84=E5=A4=84=E7=90=86=EF=BC=8C?= =?UTF-8?q?=E7=9B=AE=E7=9A=84=E6=98=AF=E5=9C=A8=E5=87=BA=E9=94=99=E5=90=8E?= =?UTF-8?q?=E7=BB=88=E6=AD=A2=20scons=20=E7=A8=8B=E5=BA=8F=EF=BC=8C?= =?UTF-8?q?=E4=BB=A5=E5=8F=91=E7=8E=B0=E5=B9=B6=E4=BF=AE=E6=94=B9=E9=94=99?= =?UTF-8?q?=E8=AF=AF=EF=BC=9B=E5=B9=B6=E5=9C=A8=E6=88=90=E5=8A=9F=E5=90=8E?= =?UTF-8?q?=E6=89=93=E5=8D=B0=20iar=20=E7=89=88=E6=9C=AC=EF=BC=8C=E4=BE=BF?= =?UTF-8?q?=E4=BA=8E=E8=B0=83=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: MurphyZhao --- tools/iar.py | 6 ++++-- 1 file 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 From 9b9175dca6ced17494338bf0e0dbd02d12cb0f5f Mon Sep 17 00:00:00 2001 From: MurphyZhao Date: Mon, 26 Aug 2019 17:49:46 +0800 Subject: [PATCH 2/2] =?UTF-8?q?[tools][update]=20=E4=BD=BF=E7=94=A8=20'--v?= =?UTF-8?q?erbose'=20=E6=8E=A7=E5=88=B6=20iar=20=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E8=BE=93=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: MurphyZhao --- tools/iar.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/iar.py b/tools/iar.py index 23cb8e11ac..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 @@ -201,5 +203,6 @@ def IARVersion(): # example stdout: IAR ANSI C/C++ Compiler V8.20.1.14183/W32 for ARM iar_version = re.search('[\d\.]+', stdout).group(0) - print("IAR version: %s" % iar_version) + if GetOption('verbose'): + print("IAR version: %s" % iar_version) return iar_version