Hi,
I have CMake 3.5.1, Arduino 1.6.10, Ubuntu 16.04.
I have observed that the generated executable has different behaviour when I compile using the following two configurations in the CMakelists:
A) Plug all the .cpp files into the generare_arduino_firmware function:
generate_arduino_firmware(${CMAKE_PROJECT_NAME}
SRCS loop.cpp ${MY_LIB_SRCS}
)
B) Create a library and link to it later:
generate_arduino_library(my_lib SRCS ${MY_LIB_SRCS})
generate_arduino_firmware(${CMAKE_PROJECT_NAME}
SRCS loop.cpp
LIBS my_lib
)
Option A) produces the desired behaviours, whereas B) produces a slightly smaller executable and it does not work as expected (Arduino restarts over and over).
Why is this happening? How can it be fixed?
Thanks!