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

Commit 4cb527d

Browse files
committed
Optimized target sketch-addition feature by avoiding unnecessary header resolving.
Also fixed a bug where the wrong file was checked for existence, affecting whether to perform conversion or not.
1 parent 9058ed6 commit 4cb527d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

cmake/Platform/Sketches/SketchManager.cmake

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,12 @@ endfunction()
2727
#=============================================================================#
2828
function(add_sketch_to_target _target_name _board_id _sketch_file)
2929

30-
resolve_sketch_headers(${_target_name} ${_board_id} "${_sketch_file}")
3130
_get_converted_source_desired_path("${_sketch_file}" sketch_converted_source_path)
3231

3332
# Only perform conversion if policy is set or if sketch hasn't been converted yet
34-
if (CONVERT_SKETCHES_IF_CONVERTED_SOURCES_EXISTS OR NOT EXISTS "${sketch_file}")
33+
if (CONVERT_SKETCHES_IF_CONVERTED_SOURCES_EXISTS OR
34+
NOT EXISTS "${sketch_converted_source_path}")
35+
resolve_sketch_headers(${_target_name} ${_board_id} "${_sketch_file}")
3536
convert_sketch_to_source("${_sketch_file}" "${sketch_converted_source_path}")
3637
endif ()
3738

0 commit comments

Comments
 (0)