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

Fix build issues when building for RP2040 from pico-examples/pico-sdk. #2151

Merged
merged 2 commits into from
Aug 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions examples/device/net_lwip_webserver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ cmake_minimum_required(VERSION 3.17)

include(${CMAKE_CURRENT_LIST_DIR}/../../../hw/bsp/family_support.cmake)

# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})

set(LWIP ${TOP}/lib/lwip)
if (NOT EXISTS ${LWIP}/src)
MESSAGE(WARNING "lib/lwip submodule not found, please run 'python tools/get_deps.py lib/lwip' to fetch it")
family_example_missing_dependency(${PROJECT} "lib/lwip")
return()
endif()

# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})

project(${PROJECT} C CXX ASM)

# Checks this example is valid for the family and initializes the project
Expand Down
5 changes: 0 additions & 5 deletions examples/host/bare_api/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,3 @@ target_include_directories(${PROJECT} PUBLIC
# Configure compilation flags and libraries for the example without RTOS.
# See the corresponding function in hw/bsp/FAMILY/family.cmake for details.
family_configure_host_example(${PROJECT} noos)

# Add pico-pio-usb for rp2040 since user can choose to run on bit-banging host
if(FAMILY STREQUAL "rp2040")
family_add_pico_pio_usb(${PROJECT})
endif()
5 changes: 0 additions & 5 deletions examples/host/cdc_msc_hid/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,3 @@ target_include_directories(${PROJECT} PUBLIC
# Configure compilation flags and libraries for the example without RTOS.
# See the corresponding function in hw/bsp/FAMILY/family.cmake for details.
family_configure_host_example(${PROJECT} noos)

# Add pico-pio-usb for rp2040 since user can choose to run on bit-banging host
if(FAMILY STREQUAL "rp2040")
family_add_pico_pio_usb(${PROJECT})
endif()
5 changes: 0 additions & 5 deletions examples/host/hid_controller/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,3 @@ target_include_directories(${PROJECT} PUBLIC
# Configure compilation flags and libraries for the example without RTOS.
# See the corresponding function in hw/bsp/FAMILY/family.cmake for details.
family_configure_host_example(${PROJECT} noos)

# Add pico-pio-usb for rp2040 since user can choose to run on bit-banging host
if(FAMILY STREQUAL "rp2040")
family_add_pico_pio_usb(${PROJECT})
endif()
5 changes: 0 additions & 5 deletions examples/host/msc_file_explorer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,3 @@ target_include_directories(${PROJECT} PUBLIC
# Configure compilation flags and libraries for the example without RTOS.
# See the corresponding function in hw/bsp/FAMILY/family.cmake for details.
family_configure_host_example(${PROJECT} noos)

# Add pico-pio-usb for rp2040 since user can choose to run on bit-banging host
if(FAMILY STREQUAL "rp2040")
family_add_pico_pio_usb(${PROJECT})
endif()
20 changes: 13 additions & 7 deletions hw/bsp/family_support.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include_guard()
include_guard(GLOBAL)

include(CMakePrintHelpers)

Expand Down Expand Up @@ -36,12 +36,14 @@ if (NOT EXISTS ${CMAKE_CURRENT_LIST_DIR}/${FAMILY}/family.cmake)
message(FATAL_ERROR "Family '${FAMILY}' is not known/supported")
endif()

# enable LTO if supported
include(CheckIPOSupported)
check_ipo_supported(RESULT IPO_SUPPORTED)
if (IPO_SUPPORTED)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
endif ()
if (NOT FAMILY STREQUAL rp2040)
# enable LTO if supported skip rp2040
include(CheckIPOSupported)
check_ipo_supported(RESULT IPO_SUPPORTED)
if (IPO_SUPPORTED)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
endif()
endif()

set(WARNING_FLAGS_GNU
-Wall
Expand Down Expand Up @@ -278,6 +280,10 @@ function(family_configure_dual_usb_example TARGET RTOS)
family_configure_example(${TARGET} ${RTOS})
endfunction()

function(family_example_missing_dependency TARGET DEPENDENCY)
message(WARNING "${DEPENDENCY} submodule needed by ${TARGET} not found, please run 'python tools/get_deps.py ${DEPENDENCY}' to fetch it")
endfunction()

#----------------------------------
# RPI specific: refactor later
#----------------------------------
Expand Down
2 changes: 1 addition & 1 deletion hw/bsp/rp2040/family.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.13)
include_guard()
include_guard(GLOBAL)

if (NOT BOARD)
message("BOARD not specified, defaulting to pico_sdk")
Expand Down