Skip to content

Commit 53fcd9d

Browse files
authored
[tools]:修复iar添加宏不完全 (#10507)
[tools]:修复iar添加宏不完全 参考#10456
1 parent f00b0a4 commit 53fcd9d

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

tools/building.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -825,7 +825,7 @@ def GenTargetProject(program = None):
825825
if GetOption('target') == 'iar':
826826
from targets.iar import IARProject, IARVersion
827827
print("IAR Version: " + IARVersion())
828-
IARProject(GetOption('project-name') + '.ewp', Projects)
828+
IARProject(Env, GetOption('project-name') + '.ewp', Projects)
829829
print("IAR project has generated successfully!")
830830

831831
if GetOption('target') == 'vs':
@@ -934,7 +934,7 @@ def EndBuilding(target, program = None):
934934
if not isinstance(project_path, str) or len(project_path) == 0:
935935
project_path = os.path.join(BSP_ROOT, 'rt-studio-project')
936936
MkDist(program, BSP_ROOT, Rtt_Root, Env, project_name, project_path)
937-
child = subprocess.Popen('scons --target=eclipse --project-name="{}"'.format(project_name),
937+
child = subprocess.Popen('scons --target=eclipse --project-name="{}"'.format(project_name),
938938
cwd=project_path, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
939939
stdout, stderr = child.communicate()
940940
need_exit = True

tools/targets/iar.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def IARWorkspace(target):
7777
out.write(xml)
7878
out.close()
7979

80-
def IARProject(target, script):
80+
def IARProject(env, target, script):
8181
project_path = os.path.dirname(os.path.abspath(target))
8282

8383
tree = etree.parse('template.ewp')
@@ -86,7 +86,7 @@ def IARProject(target, script):
8686
out = open(target, 'w')
8787

8888
CPPPATH = []
89-
CPPDEFINES = []
89+
CPPDEFINES = env.get('CPPDEFINES', [])
9090
LOCAL_CPPDEFINES = []
9191
LINKFLAGS = ''
9292
CFLAGS = ''
@@ -112,9 +112,6 @@ def searchLib(group):
112112
if 'CPPPATH' in group and group['CPPPATH']:
113113
CPPPATH += group['CPPPATH']
114114

115-
# get each group's definitions
116-
if 'CPPDEFINES' in group and group['CPPDEFINES']:
117-
CPPDEFINES += group['CPPDEFINES']
118115

119116
if 'LOCAL_CPPDEFINES' in group and group['LOCAL_CPPDEFINES']:
120117
LOCAL_CPPDEFINES += group['LOCAL_CPPDEFINES']

0 commit comments

Comments
 (0)