Guard test and docs subdirectories with EXISTS checks #3200
No reviewers
Labels
No labels
bazel
bluetooth
board settings
boot_stage2
bug
build
c++
can't reproduce
clang
clib-interface
cmsis
code cleanliness
code size
compiler version issues
cyw43_driver
debug
discussion
documentation
duplicate
dynamic_clock
elf2uf2
enhancement
errata
filesystem
flash layout
floating point
FreeRTOS
hardware_adc
hardware_claim
hardware_clocks
hardware_dma
hardware_exception
hardware_flash
hardware_gpio
hardware_i2c
hardware_irq
hardware_pio
hardware_pwm
hardware_rcp
hardware_rtc
hardware_spi
hardware_sync
hardware_uart
hardware_vreg
hardware_watchdog
hardware_xosc
help wanted
host
IAR
installation
invalid
linker scripts
lto
lwip
mbedtls
missing API
needs reporter detail
networking
newlib
newlib-multicore
non-c
non-cmake
non-gcc
openocd
orphan PR
OS integration
pico_async_context
pico_base
pico_binary_info
pico_flash
picolibc
pico_lwip
pico_malloc
pico_multicore
pico_printf
pico_runtime
pico_stdio
pico_stdio_usb
pico_sync
pico_time
pico_util
pioasm
port
question
review
review2
rtos interop
runtime init
static library
svd
test
tinyusb
vscode
wifi integration
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-raspberrypi/pico-sdk!3200
Loading…
Reference in a new issue
No description provided.
Delete branch "micro-os-plus/develop"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Allows the top-level CMakeLists.txt to configure successfully when the test or docs directories are not present, such as in a partial or stripped-down SDK checkout.
🟡 Changes recommended
The current
EXISTSchecks only verify directories, which can still allowadd_subdirectory()to fail if the directories exist but are incomplete (missingCMakeLists.txt).Get a fresh assessment by requesting another Copilot review.
Pull request overview
This PR updates the top-level SDK CMake configuration to avoid hard failures when optional
test/anddocs/subdirectories are missing, supporting partial/stripped-down SDK checkouts.Changes:
add_subdirectory(test)behindPICO_SDK_TESTS_ENABLEDplus an existence check.add_subdirectory(docs)behind an existence check so configuration succeeds without docs.File summaries
EXISTSguards around addingtest/anddocs/subdirectories to allow configuring without those directories.Review details
Suppressed comments (1)
CMakeLists.txt:65
testguard, checking only for thedocsdirectory may still allowadd_subdirectory(docs)to fail if the directory exists but is incomplete. Consider checking fordocs/CMakeLists.txtinstead to fully meet the goal of configuring successfully in stripped-down checkouts.💡 Add a
code-reviewagent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.@ -58,3 +58,3 @@endif()if (PICO_SDK_TESTS_ENABLED)if (PICO_SDK_TESTS_ENABLED AND EXISTS "${CMAKE_CURRENT_LIST_DIR}/test")add_subdirectory(test)The EXISTS guard checks only for the presence of the
testdirectory, butadd_subdirectory(test)will still fail if the directory exists without aCMakeLists.txt(e.g., an incomplete/stripped checkout). Checking fortest/CMakeLists.txtmakes the guard reliably prevent configure-time errors.This issue also appears on line 65 of the same file.
@ -58,3 +58,3 @@endif()if (PICO_SDK_TESTS_ENABLED)if (PICO_SDK_TESTS_ENABLED AND EXISTS "${CMAKE_CURRENT_LIST_DIR}/test")add_subdirectory(test)Although in theory this is a possibilty, in practice, when the SDK is stripped down to be published in lighter packages (for example @xpack-3rd-party/raspberrypi-pico-sdk), the entire folders are removed, not only the content.
But if you think that this is a valid point, I can update the PR.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.