-
Notifications
You must be signed in to change notification settings - Fork 39
Compiler flags aren't properly expanded #48
Comments
https://github.com/foriequal0/Arduino-CMake-NG/tree/feature/fix-recursive-resolve |
Whoa! That's a lot of info! As to the bug itself - Yes, it looks like something I'm partly aware of, as I've never fully completed the work there, thus recursive expansion isn't supported. Anyways I'll have a look at it and your proposed solution as well. |
@foriequal0 Hi, just a little update: |
Thank you! I'm looking forward to it! |
Just encountered this and have a temporary workaround for compiling at least. You can add the appropriate USB_VID and USB_PID defines in the CMakeLists.txt:
I haven't got any further yet though, because the upload isn't working for my Leonardo based board. The avrdude and avrdude.conf in the Arduino 1.8.7 SDK gives the error " programmer type jtagice3_updi not found". Still digging into that one |
@pjwebster Thanks for the suggestion, although not pretty it's a perfectly valid fix! |
Ironically, I don't want to use that programmer, just the normal one. After no success, I tried using add_custom_target to add an upload step using avrdude directly and bricked my board. Had to dig up my usbasp and revert to using the Arduino IDE to reload the bootloader via the icsp 😢 |
I'm sorry to hear that... Currently I have no solution for this, and unfortunately no time to investigate & possibly solve it either. |
OS: Linux
Distribution (Linux Only): Ubuntu
OS Version: 18.04
Platform: Arduino Micro
Platform SDK Version: 1.8.7
I've modified /examples/hello-world/CMakeFiles.txt as below for my Arduino Micro, and then I tried to build this, but it failed with the following build errors.
Error:
Recipe should be expanded with the board_id
I've tracked down this error.
This compiler invocation command is an expansion of following recipe.
And placeholder
{build.extra_flags}
should be overriden by following definition.refer: https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5-3rd-party-Hardware-specification#boardstxt
And finally
{build.usb_flags}
should be expanded by following definition.But
recipe.cpp.o.pattern
is expanded without the board id which used to override{build.extra_flags}
Refer: https://github.com/arduino-cmake/Arduino-CMake-NG/blob/v0.6/cmake/Platform/Properties/PropertiesReader.cmake#L14
This leads to the expansion of
recipe.cpp.o.pattern
doesn't contains{build.extra_flags}
or{micro.build.extra_flags}
I've commented that line to fix this issue, expecting later expansion should handle them with the board id, then retried a build, but I encountered the second issue.
The expansion is not recursive
Let's look at the recipie again.
It contains
{compiler.cpp.flags}
, and it is defined as follows.compiler.warning_flags
is defined as follows.But the expansion of
recipe.cpp.o.pattern
stops at the first level, this leads to an incorrect command.(it still conatins {compiler.warning_flags}
I think
_resolve_recipe_property
function doesn't expand recursively.refer: https://github.com/arduino-cmake/Arduino-CMake-NG/blob/v0.6/cmake/Platform/Properties/RecipePropertyValueResolver.cmake#L16
The text was updated successfully, but these errors were encountered: