Skip to content
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

Should extra_flags be empty in platform.txt? #599

Open
ryantm opened this issue Dec 3, 2020 · 1 comment
Open

Should extra_flags be empty in platform.txt? #599

ryantm opened this issue Dec 3, 2020 · 1 comment

Comments

@ryantm
Copy link

ryantm commented Dec 3, 2020

In my continuous integration pipeline, I was using the arduino-cli to compile an Arduino library example for the Intel:arc32:arduino_101 like:

arduino-cli compile --build-properties compiler.cpp.extra_flags='-DIN_CI' --fqbn "Intel:arc32:arduino_101" "examples/Continuous"

The IN_CI define is supposed to let me modify my code example if I'm compiling in the CI.

However, I get this error message:

/home/ryantm/.arduino15/packages/Intel/hardware/arc32/2.0.4/cores/arduino/error.h:24:19: fatal error: os/os.h: No such file or directory
 #include "os/os.h"

If I add in the cpp.extra_flags, it compiles fine:

$ arduino-cli compile --build-properties 'compiler.cpp.extra_flags=-DIN_CI -D__CPU_ARC__ -DCLOCK_SPEED=32 -DCONFIG_SOC_GPIO_32 -DCONFIG_SOC_GPIO_AON -DINFRA_MULTI_CPU_SUPPORT -DCFW_MULTI_CPU_SUPPORT -DHAS_SHARED_MEM -I{build.system.path}/libarc32_arduino101/common -I{build.system.path}/libarc32_arduino101/drivers -I{build.system.path}/libarc32_arduino101/bootcode -I{build.system.path}/libarc32_arduino101/framework/include' --fqbn "Intel:arc32:arduino_101" "examples/Continuous"
Sketch uses 20708 bytes (13%) of program storage space. Maximum is 155648 bytes.

I also noticed that the avr core does not populate these extra_flags.

I haven't found documentation on it, but I believe that the extra_flags should be empty so that the local build system can use them.

ryantm added a commit to ryantm/ArduinoCore-arc32 that referenced this issue Dec 3, 2020
resolves arduino#599

By leaving extra_flags empty, we leave a hook for the end-user to use
without having to duplicate a bunch of flags. This matches how the AVR
core leaves the extra_flags blank.
@matthijskooijman
Copy link
Collaborator

See arduino/arduino-cli#846 for some related discussion.

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

Successfully merging a pull request may close this issue.

2 participants