Skip to content

mbed compile's --cflags option #3384

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

Closed
Nodraak opened this issue Dec 7, 2016 · 2 comments
Closed

mbed compile's --cflags option #3384

Nodraak opened this issue Dec 7, 2016 · 2 comments

Comments

@Nodraak
Copy link
Contributor

Nodraak commented Dec 7, 2016

Description


Question

(mbed-cli version 0.9.1 / meed-os sha ea3526d)

How to pass flags to the C and CPP compilers (like -E or -O0 or -mfloat-abi=soft). I saw the mbed compile's --cflags option, but it is not taken into account (I can see that thanks to the mbed compile's -v flags that print the actual executed command).

From the issues of this repo I saw that it might have been replaced by profile files but I have no clue about how to write this damn json (where, what name, ...).

Anyway, if the cli accept the --cflags option, I would expect it to be took into account or at least show a warning if it was to ignore them silently.

Thanks for your help !

@theotherjimmy
Copy link
Contributor

Hey @Nodraak!

From the issues of this repo I saw that it might have been replaced by profile files but I have no clue about how to write this damn json (where, what name, ...).

The documentation you are looking for is here: https://github.com/ARMmbed/mbed-os/blob/master/docs/Toolchain_Profiles.md . TL;DR: pass the filename to mbed compile's --profile option. e.g. mbed compile -t gcc_arm -m k64f --profile my_profile.json would build you project with arm-none-eabi-gcc, for the frdm-k64f, using the profile found in my_profile.json.

There are three examples in the codebase: https://github.com/ARMmbed/mbed-os/tree/master/tools/profiles

You could copy one of these files and modify it to suit your needs.

Anyway, if the cli accept the --cflags option, I would expect it to be took into account or at least show a warning if it was to ignore them silently.

Agreed. That's why I created #3385 .

@theotherjimmy
Copy link
Contributor

#3385 merged. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants