Skip to content

Commit 42d671c

Browse files
committed
Fixing problem when using HDRS, LIBS, AFLAGS options with generate_avr_firmware
These options might be set or left out (i.e. empty). So the variables holding the values (e.g. INPUT_HDRS for HDRS) are checked whether they are empty or not. If they are not empty the according option name should be added to the front of the list. This has been done by setting the variable with a string containing the option name followed by a space and the variable content. The result is not a list with the option name as first element. Since the space character doesn't work as a list item delimiter, the first element is a mixture of option name, space and the old first element in the list. This didn't get parsed later and resulted in all these options getting added to the SRCS option. I changed the update of the lists to use the cmake list functions. The proper option name gets now inserted into the lists at the beginning.
1 parent 750ce82 commit 42d671c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cmake/Platform/Arduino.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -546,13 +546,13 @@ function(GENERATE_AVR_FIRMWARE INPUT_NAME)
546546
required_variables(VARS INPUT_BOARD INPUT_SRCS MSG "must define for target ${INPUT_NAME}")
547547

548548
if(INPUT_HDRS)
549-
set( INPUT_HDRS "SRCS ${INPUT_HDRS}" )
549+
list(INSERT INPUT_HDRS 0 "HDRS")
550550
endif()
551551
if(INPUT_LIBS)
552-
set( INPUT_LIBS "LIBS ${INPUT_LIBS}" )
552+
list(INSERT INPUT_LIBS 0 "LIBS")
553553
endif()
554554
if(INPUT_AFLAGS)
555-
set( INPUT_AFLAGS "AFLAGS ${INPUT_AFLAGS}" )
555+
list(INSERT INPUT_AFLAGS 0 "AFLAGS")
556556
endif()
557557

558558
generate_arduino_firmware( ${INPUT_NAME}

0 commit comments

Comments
 (0)