Skip to content

Commit 6a747b3

Browse files
committed
pick up new version of pico_sdk_import.cmake - only really relevant to optimize git download of pico-sdk
1 parent 2cb4d4a commit 6a747b3

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

pico_sdk_import.cmake

+16-5
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,22 @@ if (NOT PICO_SDK_PATH)
2929
if (PICO_SDK_FETCH_FROM_GIT_PATH)
3030
get_filename_component(FETCHCONTENT_BASE_DIR "${PICO_SDK_FETCH_FROM_GIT_PATH}" REALPATH BASE_DIR "${CMAKE_SOURCE_DIR}")
3131
endif ()
32-
FetchContent_Declare(
33-
pico_sdk
34-
GIT_REPOSITORY https://github.com/raspberrypi/pico-sdk
35-
GIT_TAG master
36-
)
32+
# GIT_SUBMODULES_RECURSE was added in 3.17
33+
if (${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.17.0")
34+
FetchContent_Declare(
35+
pico_sdk
36+
GIT_REPOSITORY https://github.com/raspberrypi/pico-sdk
37+
GIT_TAG master
38+
GIT_SUBMODULES_RECURSE FALSE
39+
)
40+
else ()
41+
FetchContent_Declare(
42+
pico_sdk
43+
GIT_REPOSITORY https://github.com/raspberrypi/pico-sdk
44+
GIT_TAG master
45+
)
46+
endif ()
47+
3748
if (NOT pico_sdk)
3849
message("Downloading Raspberry Pi Pico SDK")
3950
FetchContent_Populate(pico_sdk)

0 commit comments

Comments
 (0)