Skip to content

Commit 3267ac4

Browse files
leo sartrea9183756-gh
authored andcommitted
Set extra.time.local property in SetupBoardToolchain function
Teensy board.txt file is using extra.time.local to define __rtc_localtime symbol at link time. For Linux, using `date +'%s'` gives epoch time, use this comand to compute time using subprocess_command. Signed-off-by: leo sartre <leo.sartre@e.email>
1 parent a98d20d commit 3267ac4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Arduino/System/BoardToolchain.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,12 @@ function (SetupBoardToolchain boards_namespace board_id generate_dir)
180180
endif()
181181
properties_set_value("ard_global" "runtime.os" "${ARDUINO_BOARD_HOST_NAME}")
182182

183+
# Set some extra properties
184+
if (${CMAKE_HOST_UNIX})
185+
execute_process(COMMAND "date" "+'%s'" OUTPUT_VARIABLE EPOCH)
186+
properties_set_value("ard_global" "extra.time.local" "${EPOCH}")
187+
endif()
188+
183189
# Packager of the selected board
184190
_board_get_platform_property("/pkg_id" pkg_id)
185191
_board_get_platform_property("/json_idx" json_idx)

0 commit comments

Comments
 (0)