Skip to content

Commit 2f3ba1b

Browse files
committed
Consistently add the .cpp extension to sketches
1 parent 536fd24 commit 2f3ba1b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

toolchain/arduino-cli-toolchain.cmake

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -677,6 +677,10 @@ function(__arduino_resolve_preprocessed_filepath SOURCE_DIRPATH FILENAME OUTPUT_
677677
BASE_DIRECTORY "${SOURCE_DIRPATH}"
678678
OUTPUT_VARIABLE _relative_filepath)
679679

680+
if (_relative_filepath MATCHES "${__ARDUINO_SKETCH_SUFFIX}")
681+
string(APPEND _relative_filepath ".cpp")
682+
endif()
683+
680684
set("${OUTPUT_VARIABLE}" "${OUTPUT_DIRPATH}/${_relative_filepath}" PARENT_SCOPE)
681685
else()
682686
unset("${OUTPUT_VARIABLE}" PARENT_SCOPE)
@@ -818,10 +822,6 @@ function(__arduino_preprocess OUTPUT_VARIABLE OUTPUT_DIRPATH SOURCE_DIRPATH MODE
818822
"${SOURCE_DIRPATH}" "${_source_filepath}"
819823
"${OUTPUT_DIRPATH}" _output_filepath)
820824

821-
if (MODE STREQUAL "SKETCH")
822-
string(APPEND _output_filepath ".cpp")
823-
endif()
824-
825825
string(MD5 _filepath_hash "${_output_filepath}")
826826
set(_config_filepath "${CMAKE_BINARY_DIR}/ArduinoFiles/${_target}/preprocess-config-${_filepath_hash}.cmake")
827827

0 commit comments

Comments
 (0)