summaryrefslogtreecommitdiff
path: root/tools/codeblocks.py
diff options
context:
space:
mode:
authorBernard Xiong <[email protected]>2013-06-16 19:33:58 -0700
committerBernard Xiong <[email protected]>2013-06-16 19:33:58 -0700
commitdddc71d8a1ffe9d74ae60b33af75d397a4c69131 (patch)
tree15b1d49884c0f93f38952e3ff45388d695b581c3 /tools/codeblocks.py
parent4d70222c7137faa0e589863327eb6a376b47a1ad (diff)
parentfd289ff34f7006e8d9932e83e6eef2afdc601f5f (diff)
Merge pull request #105 from aozima/pulls
完善生成codeblock工程功能。
Diffstat (limited to 'tools/codeblocks.py')
-rw-r--r--tools/codeblocks.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/codeblocks.py b/tools/codeblocks.py
index f46f0f1f93..78f9629cbb 100644
--- a/tools/codeblocks.py
+++ b/tools/codeblocks.py
@@ -38,8 +38,12 @@ def CB_AddCFiles(ProjectFiles, parent, gname, files, project_path):
def CBProject(target, script, program):
project_path = os.path.dirname(os.path.abspath(target))
+
+ if os.path.isfile('template.cbp'):
+ tree = etree.parse('template.cbp')
+ else:
+ tree = etree.parse(os.path.join(os.path.dirname(__file__), 'template.cbp'))
- tree = etree.parse('template.cbp')
root = tree.getroot()
out = file(target, 'wb')
@@ -75,7 +79,7 @@ def CBProject(target, script, program):
Add = SubElement(elem, 'Add')
Add.set('directory', path)
- for macro in building.Env['CPPDEFINES']:
+ for macro in building.Env.get('CPPDEFINES', []):
Add = SubElement(elem, 'Add')
Add.set('option', "-D"+macro)