Skip to content

Commit

Permalink
Fix compilation for PICO_BOARD=pico_w when cyw43_arch is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
lurch committed Aug 22, 2024
1 parent 724236a commit 0dc6d16
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
10 changes: 9 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 10 additions & 2 deletions adc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
endif()

0 comments on commit 0dc6d16

Please sign in to comment.