Skip to content

Different behaviour if creating library instead of using all sources in generate_firmware #167

@carlosgalvezp

Description

@carlosgalvezp

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions