summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorRbb666 <[email protected]>2024-03-04 15:20:36 +0800
committerMeco Man <[email protected]>2024-03-05 19:53:53 -0500
commitd31c05a44c75a0b60b9e10f23bfeab35ef152719 (patch)
tree9c6d3e9f34999c9afacb3fef5a92f97e753969d7 /tools
parent784f764a275eb1bb60a3d0b6c37ac2fe29b7c3de (diff)
[tools]Fix project compilation errors generated by mdk and iar
Diffstat (limited to 'tools')
-rw-r--r--tools/iar.py8
-rw-r--r--tools/keil.py2
2 files changed, 9 insertions, 1 deletions
diff --git a/tools/iar.py b/tools/iar.py
index fc2bc44f91..56c4cb487f 100644
--- a/tools/iar.py
+++ b/tools/iar.py
@@ -87,6 +87,7 @@ def IARProject(target, script):
CPPPATH = []
CPPDEFINES = []
+ LOCAL_CPPDEFINES = []
LINKFLAGS = ''
CFLAGS = ''
Libs = []
@@ -115,6 +116,9 @@ def IARProject(target, script):
if 'CPPDEFINES' in group and group['CPPDEFINES']:
CPPDEFINES += group['CPPDEFINES']
+ if 'LOCAL_CPPDEFINES' in group and group['LOCAL_CPPDEFINES']:
+ LOCAL_CPPDEFINES += group['LOCAL_CPPDEFINES']
+
# get each group's link flags
if 'LINKFLAGS' in group and group['LINKFLAGS']:
LINKFLAGS += group['LINKFLAGS']
@@ -154,6 +158,10 @@ def IARProject(target, script):
state = SubElement(option, 'state')
state.text = define
+ for define in LOCAL_CPPDEFINES:
+ state = SubElement(option, 'state')
+ state.text = define
+
if name.text == 'IlinkAdditionalLibs':
for path in Libs:
state = SubElement(option, 'state')
diff --git a/tools/keil.py b/tools/keil.py
index b4c5e03388..2c9f239f1e 100644
--- a/tools/keil.py
+++ b/tools/keil.py
@@ -186,7 +186,7 @@ def MDK4AddGroup(ProjectFiles, parent, name, files, project_path, group_scons):
MiscControls_text = MiscControls_text + group_scons['LOCAL_CXXFLAGS']
if 'LOCAL_CCFLAGS' in group_scons:
MiscControls_text = MiscControls_text + group_scons['LOCAL_CCFLAGS']
- if MiscControls_text != ' ':
+ if MiscControls_text != ' ' or ('LOCAL_CPPDEFINES' in group_scons):
FileOption = SubElement(file, 'FileOption')
FileArmAds = SubElement(FileOption, 'FileArmAds')
Cads = SubElement(FileArmAds, 'Cads')