summaryrefslogtreecommitdiff
path: root/tools/iar.py
diff options
context:
space:
mode:
authoraozima <[email protected]>2013-06-22 23:22:30 +0800
committeraozima <[email protected]>2013-06-22 23:22:30 +0800
commit0633e9853c6ce4713a28812a1200a2f77a366a40 (patch)
treece3a2382365861bf3afc06c6f06029b4292830a9 /tools/iar.py
parentbde2e918daa44dd3fe859b630edfcb983b9ac6ff (diff)
update iar.py: fixed bug when path is absolute.
Diffstat (limited to 'tools/iar.py')
-rw-r--r--tools/iar.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/tools/iar.py b/tools/iar.py
index 040020aa6c..40b8408971 100644
--- a/tools/iar.py
+++ b/tools/iar.py
@@ -37,7 +37,10 @@ def IARAddGroup(parent, name, files, project_path):
file = SubElement(group, 'file')
file_name = SubElement(file, 'name')
- file_name.text = ('$PROJ_DIR$\\' + path).decode(fs_encoding)
+ if os.path.isabs(path):
+ file_name.text = path.decode(fs_encoding)
+ else:
+ file_name.text = ('$PROJ_DIR$\\' + path).decode(fs_encoding)
def IARWorkspace(target):
# make an workspace
@@ -91,7 +94,11 @@ def IARProject(target, script):
if name.text == 'CCIncludePath2' or name.text == 'newCCIncludePaths':
for path in paths:
state = SubElement(option, 'state')
- state.text = '$PROJ_DIR$\\' + path
+ if os.path.isabs(path):
+ state.text = path
+ else:
+ state.text = '$PROJ_DIR$\\' + path
+
if name.text == 'CCDefines':
for define in CPPDEFINES:
state = SubElement(option, 'state')