ArduinoCore-arc32 icon indicating copy to clipboard operation
ArduinoCore-arc32 copied to clipboard

Should extra_flags be empty in platform.txt?

Open ryantm opened this issue 4 years ago • 1 comments

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 avatar Dec 03 '20 17:12 ryantm

See https://github.com/arduino/arduino-cli/issues/846 for some related discussion.

matthijskooijman avatar Dec 03 '20 17:12 matthijskooijman