Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated uses of FetchContent_Populate #2169

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

will-v-pi
Copy link
Contributor

This removes the deprecated uses of FetchContent_Populate (see #2124)

The SDK cannot just use MakeAvailable as the files shouldn't be added to the build, so instead this uses the full signature for FetchContent_Populate which has not been deprecated. The FetchContent_Declare call is kept in pico_sdk_import.cmake else it will re-clone the SDK for every new build directory when PICO_SDK_FETCH_FROM_GIT_PATH is set, rather than re-using the cloned SDK in PICO_SDK_FETCH_FROM_GIT_PATH.

Fixes #2124

Cannot use MakeAvailable as the files shouldn't be added to the build, so instead uses the full signature for FetchContent_Populate

Fixes raspberrypi#2124
@will-v-pi will-v-pi added this to the 2.1.1 milestone Jan 7, 2025
@will-v-pi will-v-pi requested a review from kilograham January 7, 2025 15:56
@@ -40,25 +40,26 @@ if (NOT PICO_SDK_PATH)
if (PICO_SDK_FETCH_FROM_GIT_PATH)
get_filename_component(FETCHCONTENT_BASE_DIR "${PICO_SDK_FETCH_FROM_GIT_PATH}" REALPATH BASE_DIR "${CMAKE_SOURCE_DIR}")
endif ()
# GIT_SUBMODULES_RECURSE was added in 3.17
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the new version of the code still need to do something different if we're using an older version of CMake which doesn't support GIT_SUBMODULES_RECURSE ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I will fix that - although I was wondering if we should remove that anyway, as there are no longer any recursive submodules now that TinyUSB doesn't have any submodules?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now that TinyUSB doesn't have any submodules

Good point, I hadn't considered that! But might be better to err on the side of caution though, just in case we add any other submodules in future which do have submodules of their own? 🤔


SOURCE_DIR ${FETCHCONTENT_BASE_DIR}/pico_sdk-src
BINARY_DIR ${FETCHCONTENT_BASE_DIR}/pico_sdk-build
SUBBUILD_DIR ${FETCHCONTENT_BASE_DIR}/pico_sdk-subbuild
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we ever use this "subbuild" anywhere do we? Do we need to specify it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants