From 0dc6d1685dd1512c6d479834f8e06bb645ab690b Mon Sep 17 00:00:00 2001 From: Andrew Scheller Date: Thu, 22 Aug 2024 10:34:17 +0100 Subject: [PATCH] Fix compilation for PICO_BOARD=pico_w when cyw43_arch is missing --- CMakeLists.txt | 10 +++++++++- adc/CMakeLists.txt | 12 ++++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 59c958630..58ee47148 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,7 +43,15 @@ function(add_subdirectory_exclude_platforms NAME) endfunction() # Add blink example -add_subdirectory_exclude_platforms(blink) +if (PICO_CYW43_SUPPORTED) # set by PICO_BOARD=pico_w + if (NOT TARGET pico_cyw43_arch) + message("Skipping blink for Pico W as support is not available") + else() + add_subdirectory_exclude_platforms(blink) + endif() +else() + add_subdirectory_exclude_platforms(blink) +endif() add_subdirectory_exclude_platforms(blink_simple) # Add hello world example diff --git a/adc/CMakeLists.txt b/adc/CMakeLists.txt index 71c423541..b628a4547 100644 --- a/adc/CMakeLists.txt +++ b/adc/CMakeLists.txt @@ -5,7 +5,15 @@ if (TARGET hardware_adc) add_subdirectory_exclude_platforms(joystick_display) add_subdirectory_exclude_platforms(onboard_temperature) add_subdirectory_exclude_platforms(microphone_adc) - add_subdirectory_exclude_platforms(read_vsys) + if (PICO_CYW43_SUPPORTED) # set by PICO_BOARD=pico_w + if (NOT TARGET pico_cyw43_arch) + message("Skipping read_vsys for Pico W as support is not available") + else() + add_subdirectory_exclude_platforms(read_vsys) + endif() + else() + add_subdirectory_exclude_platforms(read_vsys) + endif() else() message("Skipping ADC examples as hardware_adc is unavailable on this platform") -endif() \ No newline at end of file +endif()