Merge pull request #2151 from kilograham/rp2040_build_fixes

Fix build issues when building for RP2040 from pico-examples/pico-sdk.
This commit is contained in:
Ha Thach
2023-08-07 11:14:04 +07:00
committed by GitHub
7 changed files with 20 additions and 34 deletions

View File

@@ -1,4 +1,4 @@
include_guard()
include_guard(GLOBAL)
include(CMakePrintHelpers)
@@ -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
@@ -288,6 +290,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
#----------------------------------