-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code::Blocks project file exporter #6481
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please split all lines around 80 characters.
Further, this seems very NCS36510 specific. Could you submit the exporter and the NCS changes separately?
KEEP(*(.trim)) | ||
} > TRIM | ||
|
||
.isr_vector : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change, and all other changis in this file, are not related to creating an exporter. Please submit them as another PR.
tools/export/codeblocks/__init__.py
Outdated
if f.startswith('-O') or f.startswith('-g'): | ||
debug_flags.append(f) | ||
continue | ||
comp_flags.append(f) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line should be in an else branch. Please rewrite the prior 4 lines as:
if f.startswith('-O') or f.startswith('-g):
debug_flags.append(f)
else:
comp_flags.append(f)
tools/export/codeblocks/__init__.py
Outdated
debug_flags = [] | ||
next_is_include = False | ||
for f in self.flags['c_flags'] + self.flags['cxx_flags'] + self.flags['common_flags']: | ||
f=f.strip() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please put spaces around the =
.
tools/export/codeblocks/cbp.tmpl
Outdated
{% if ncs36510addfib -%} | ||
<ExtraCommands> | ||
<Add after="arm-none-eabi-objcopy -O ihex -R .fib -R .trim bin/Debug/{{project_name}}.elf bin/Debug/{{project_name}}.hex" /> | ||
<Add after="mbed-os/tools/export/codeblocks/ncs36510addfib.py bin/Debug/{{project_name}}.hex bin/Debug/{{project_name}}.fib" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not allowed: after export on the website, a project will not contain the tools.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where would be the proper place for such a tool?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is where things get tricky. You could export that python script so that it is in the root of the project, then you can rely on it's existence. You can rely on anything in resources, and anything you explicitly create, so if you explicitly create the file, you're good to go. I, and possibly future users, would appreciate an addition to the third party notes section explaining that you need Python to compile with Code::Blocks and NCS36510.
tools/export/codeblocks/cbp.tmpl
Outdated
{% if ncs36510addfib -%} | ||
<ExtraCommands> | ||
<Add after="arm-none-eabi-objcopy -O ihex -R .fib -R .trim bin/Release/{{project_name}}.elf bin/Release/{{project_name}}.hex" /> | ||
<Add after="mbed-os/tools/export/codeblocks/ncs36510addfib.py bin/Release/{{project_name}}.hex bin/Release/{{project_name}}.fib" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto for this line.
tools/export/codeblocks/__init__.py
Outdated
inc_dirs = [x for x in inc_dirs if x is not None and x != '' and x != '.' and not x.startswith('bin') and not x.startswith('obj')]; | ||
|
||
c_sources = [self.filter_dot(s) for s in self.resources.c_sources] | ||
targ = TARGET_MAP[self.target] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You will not have any configuration variables overridden on this target, making configuration incorrect. Please use self.toolchain.target
instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Thanks.
/morph build |
Build : SUCCESSBuild number : 1626 Triggering tests/morph test |
Test : SUCCESSBuild number : 1411 |
Exporter Build : SUCCESSBuild number : 1256 |
0962c2f
to
ffbc9ee
Compare
/morph build |
Build : SUCCESSBuild number : 1641 Triggering tests/morph test |
Similar problem with jenkins CI as reported here #6510 (comment), investigating |
Exporter Build : SUCCESSBuild number : 1273 |
cc @ARMmbed/team-onsemi |
Test : SUCCESSBuild number : 1430 |
/morph mbed2-build |
… to be accessible in the template directory
…gnore so mbed compile doesn't pick them up
…m getting confused
5456369
to
696a7f5
Compare
@tsailer Is this completed? I noticed some new commits. Restarting the CI /morph build |
@0xc0170 yes, the generic part of the exporter is finished now |
Build : SUCCESSBuild number : 1674 Triggering tests/morph test |
Exporter Build : FAILUREBuild number : 1307 |
No failures on that exporter job... |
Test : SUCCESSBuild number : 1468 |
/morph export-build |
Exporter Build : SUCCESSBuild number : 1311 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Thanks.
Description
Add an exporter for Code::Blocks project files. It outputs native Code::Blocks projects, i.e. not makefile projects. Furthermore, if the target is NCS36510, it adds the necessary post build steps to add the required fib block to the generated elf file.
Pull request type
[ ] Fix
[ ] Refactor
[X] New target
[ ] Feature
[ ] Breaking change