mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-01-22 15:37:53 +08:00
commit
dddc71d8a1
@ -38,8 +38,12 @@ def CB_AddCFiles(ProjectFiles, parent, gname, files, project_path):
|
|||||||
|
|
||||||
def CBProject(target, script, program):
|
def CBProject(target, script, program):
|
||||||
project_path = os.path.dirname(os.path.abspath(target))
|
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()
|
root = tree.getroot()
|
||||||
|
|
||||||
out = file(target, 'wb')
|
out = file(target, 'wb')
|
||||||
@ -75,7 +79,7 @@ def CBProject(target, script, program):
|
|||||||
Add = SubElement(elem, 'Add')
|
Add = SubElement(elem, 'Add')
|
||||||
Add.set('directory', path)
|
Add.set('directory', path)
|
||||||
|
|
||||||
for macro in building.Env['CPPDEFINES']:
|
for macro in building.Env.get('CPPDEFINES', []):
|
||||||
Add = SubElement(elem, 'Add')
|
Add = SubElement(elem, 'Add')
|
||||||
Add.set('option', "-D"+macro)
|
Add.set('option', "-D"+macro)
|
||||||
|
|
||||||
|
41
tools/template.cbp
Normal file
41
tools/template.cbp
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||||
|
<CodeBlocks_project_file>
|
||||||
|
<FileVersion major="1" minor="6" />
|
||||||
|
<Project>
|
||||||
|
<Option title="project" />
|
||||||
|
<Option pch_mode="2" />
|
||||||
|
<Option compiler="gcc" />
|
||||||
|
<Build>
|
||||||
|
<Target title="Debug">
|
||||||
|
<Option output="build/bin/Debug/project" prefix_auto="1" extension_auto="1" />
|
||||||
|
<Option object_output="build/obj/Debug/" />
|
||||||
|
<Option type="1" />
|
||||||
|
<Option compiler="gcc" />
|
||||||
|
<Compiler>
|
||||||
|
<Add option="-g" />
|
||||||
|
</Compiler>
|
||||||
|
</Target>
|
||||||
|
<Target title="Release">
|
||||||
|
<Option output="build/bin/Release/project" prefix_auto="1" extension_auto="1" />
|
||||||
|
<Option object_output="build/obj/Release/" />
|
||||||
|
<Option type="1" />
|
||||||
|
<Option compiler="gcc" />
|
||||||
|
<Compiler>
|
||||||
|
<Add option="-O2" />
|
||||||
|
</Compiler>
|
||||||
|
<Linker>
|
||||||
|
<Add option="-s" />
|
||||||
|
</Linker>
|
||||||
|
</Target>
|
||||||
|
</Build>
|
||||||
|
<Compiler>
|
||||||
|
<Add option="-Wall" />
|
||||||
|
</Compiler>
|
||||||
|
<Extensions>
|
||||||
|
<code_completion />
|
||||||
|
<envvars />
|
||||||
|
<debugger />
|
||||||
|
<lib_finder disable_auto="1" />
|
||||||
|
</Extensions>
|
||||||
|
</Project>
|
||||||
|
</CodeBlocks_project_file>
|
Loading…
x
Reference in New Issue
Block a user