[tools]:修复iar添加宏不完全 (#10507)

[tools]:修复iar添加宏不完全
参考#10456
This commit is contained in:
蒙蒙plus 2025-07-15 13:33:40 +08:00 committed by GitHub
parent f00b0a4384
commit 53fcd9d085
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 7 deletions

View File

@ -825,7 +825,7 @@ def GenTargetProject(program = None):
if GetOption('target') == 'iar':
from targets.iar import IARProject, IARVersion
print("IAR Version: " + IARVersion())
IARProject(GetOption('project-name') + '.ewp', Projects)
IARProject(Env, GetOption('project-name') + '.ewp', Projects)
print("IAR project has generated successfully!")
if GetOption('target') == 'vs':
@ -934,7 +934,7 @@ def EndBuilding(target, program = None):
if not isinstance(project_path, str) or len(project_path) == 0:
project_path = os.path.join(BSP_ROOT, 'rt-studio-project')
MkDist(program, BSP_ROOT, Rtt_Root, Env, project_name, project_path)
child = subprocess.Popen('scons --target=eclipse --project-name="{}"'.format(project_name),
child = subprocess.Popen('scons --target=eclipse --project-name="{}"'.format(project_name),
cwd=project_path, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
stdout, stderr = child.communicate()
need_exit = True

View File

@ -77,7 +77,7 @@ def IARWorkspace(target):
out.write(xml)
out.close()
def IARProject(target, script):
def IARProject(env, target, script):
project_path = os.path.dirname(os.path.abspath(target))
tree = etree.parse('template.ewp')
@ -86,7 +86,7 @@ def IARProject(target, script):
out = open(target, 'w')
CPPPATH = []
CPPDEFINES = []
CPPDEFINES = env.get('CPPDEFINES', [])
LOCAL_CPPDEFINES = []
LINKFLAGS = ''
CFLAGS = ''
@ -112,9 +112,6 @@ def IARProject(target, script):
if 'CPPPATH' in group and group['CPPPATH']:
CPPPATH += group['CPPPATH']
# get each group's definitions
if 'CPPDEFINES' in group and group['CPPDEFINES']:
CPPDEFINES += group['CPPDEFINES']
if 'LOCAL_CPPDEFINES' in group and group['LOCAL_CPPDEFINES']:
LOCAL_CPPDEFINES += group['LOCAL_CPPDEFINES']