From 5f474ed26c993d26d241ff2398ddb776069e44ea Mon Sep 17 00:00:00 2001 From: "Man, Jianting (Meco)" <920369182@qq.com> Date: Wed, 24 Aug 2022 22:39:21 -0400 Subject: [scons] 使用target=mdk5 和 iar时,打印IDE版本号 (#6315) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [scons] 使用target=mdk5 和 iar时,打印IDE版本号 * 移除对keil iar生成功能的检查 1.这些工程是否可以生成是BSP可选项,不是每个BSP都支持 2.CI环境中并没有安转IAR和Keil环境,导致直接获取IDE版本失败 * MDKProject函数重命名为MDK2Project --- tools/building.py | 43 +++++++++++++++++-------------------------- 1 file changed, 17 insertions(+), 26 deletions(-) (limited to 'tools/building.py') diff --git a/tools/building.py b/tools/building.py index 91c6d05c99..d518441151 100644 --- a/tools/building.py +++ b/tools/building.py @@ -784,35 +784,26 @@ def DoBuilding(target, objects): def GenTargetProject(program = None): - if GetOption('target') == 'mdk': - from keil import MDKProject - from keil import MDK4Project - from keil import MDK5Project - - template = os.path.isfile('template.Uv2') - if template: - MDKProject('project.Uv2', Projects) + if GetOption('target') in ['mdk', 'mdk4', 'mdk5']: + from keil import MDK2Project, MDK4Project, MDK5Project, ARMCC_Version + + if os.path.isfile('template.uvprojx') and GetOption('target') not in ['mdk4']: # Keil5 + MDK5Project('project.uvprojx', Projects) + print("Keil5 project is generating...") + elif os.path.isfile('template.uvproj') and GetOption('target') not in ['mdk5']: # Keil4 + MDK4Project('project.uvproj', Projects) + print("Keil4 project is generating...") + elif os.path.isfile('template.Uv2') and GetOption('target') not in ['mdk4', 'mdk5']: # Keil2 + MDK2Project('project.Uv2', Projects) + print("Keil2 project is generating...") else: - template = os.path.isfile('template.uvproj') - if template: - MDK4Project('project.uvproj', Projects) - else: - template = os.path.isfile('template.uvprojx') - if template: - MDK5Project('project.uvprojx', Projects) - else: - print ('No template project file found.') - - if GetOption('target') == 'mdk4': - from keil import MDK4Project - MDK4Project('project.uvproj', Projects) - - if GetOption('target') == 'mdk5': - from keil import MDK5Project - MDK5Project('project.uvprojx', Projects) + print ('No template project file found.') + exit(1) + print("Keil Version: " + ARMCC_Version()) if GetOption('target') == 'iar': - from iar import IARProject + from iar import IARProject, IARVersion + print("IAR Version: " + IARVersion()) IARProject('project.ewp', Projects) if GetOption('target') == 'vs': -- cgit v1.3.1