Skip to content
This repository was archived by the owner on Apr 17, 2023. It is now read-only.

Commit 1ddf71f

Browse files
committed
Updated add_arduino_library function to use new argument parsing utility.
1 parent 83ca465 commit 1ddf71f

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

cmake/Platform/Targets/ArduinoLibraryTarget.cmake

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,21 @@
66
# _sources - Source and header files to create target from.
77
# [LIB_PROPS_FILE] - Full path to the library's properties file. Optional.
88
#=============================================================================#
9-
function(add_arduino_library _target_name _board_id _library_root_dir _sources)
9+
function(add_arduino_library _target_name _board_id)
10+
11+
cmake_parse_arguments(parsed_args "" "LIB_PROPS_FILE" "" ${ARGN})
12+
parse_sources_arguments(parsed_sources "" "LIB_PROPS_FILE" "" "${ARGN}")
1013

1114
resolve_library_architecture(${_library_root_dir} "${_sources}" arch_resolved_sources "${ARGN}")
1215

13-
_add_arduino_cmake_library(${_target_name} ${_board_id} "${arch_resolved_sources}" "${ARGN}")
16+
if (parsed_args_LIB_PROPS_FILE)
17+
resolve_library_architecture(${library_root_dir} "${parsed_sources}" arch_resolved_sources
18+
LIB_PROPS_FILE ${parsed_args_LIB_PROPS_FILE})
19+
else ()
20+
resolve_library_architecture(${library_root_dir} "${parsed_sources}" arch_resolved_sources)
21+
endif ()
22+
23+
_add_arduino_cmake_library(${_target_name} ${_board_id} "${arch_resolved_sources}")
1424

1525
find_dependent_platform_libraries("${arch_resolved_sources}" lib_platform_libs)
1626

0 commit comments

Comments
 (0)