Add LIBS input property to GENERATE_ARDUINO_EXAMPLE #3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This allows users to add static libraries to fix linking errors with
generate_arduino_example
that can sometimes occur.Some arduino examples with multiple dependencies give linking errors (undefined references) when built with the
generate_arduino_example
command. For example,Will fail to properly link with the SPI library. There is possibly a way to fix this under-the-hood with improved dependency discovery. I don't know where to start with this. As work-around that is perfectly consistent with the other arduino-cmake function, this change adds the LIBS input argument to
generate_arduino_example
. This works like the existing LIBS inputs ongenerate_arduino_firmware
andgenerate_arduino_library
The user can now use
generate_arduino_library
to create a static library for SPI, and then build the example withThe cmake source code for the
generate_arduino_example
already handledthis input since it contains
list(APPEND ALL_LIBS ${CORE_LIB} ${INPUT_LIBS})
, so no changes were necessary for the function itself.Hopefully this is helpful.