summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhathach <[email protected]>2024-04-19 14:05:31 +0700
committerhathach <[email protected]>2024-04-19 23:17:01 +0700
commit4a183d2e3fd0acb54002fa22dc1dc9be5c1a23f4 (patch)
tree060298b3434bcbced3d46e64fd5f48b4f218092b
parentbe0d62ba6c84e6c44416f5a837d830000f316505 (diff)
try to add clang for rp2040 but pico-sdk does not support that. (got assert.h file not found)
-rw-r--r--hw/bsp/rp2040/family.cmake22
1 files changed, 14 insertions, 8 deletions
diff --git a/hw/bsp/rp2040/family.cmake b/hw/bsp/rp2040/family.cmake
index 861d20bdd..a298e684b 100644
--- a/hw/bsp/rp2040/family.cmake
+++ b/hw/bsp/rp2040/family.cmake
@@ -6,6 +6,12 @@ if (NOT BOARD)
set(BOARD pico_sdk)
endif()
+if (TOOLCHAIN STREQUAL "clang")
+ set(PICO_COMPILER "pico_arm_clang")
+else()
+ set(PICO_COMPILER "pico_arm_gcc")
+endif()
+
# add the SDK in case we are standalone tinyusb example (noop if already present)
include(${CMAKE_CURRENT_LIST_DIR}/pico_sdk_import.cmake)
@@ -30,13 +36,13 @@ endif()
add_library(tinyusb_common_base INTERFACE)
target_sources(tinyusb_common_base INTERFACE
- ${TOP}/src/tusb.c
- ${TOP}/src/common/tusb_fifo.c
- )
+ ${TOP}/src/tusb.c
+ ${TOP}/src/common/tusb_fifo.c
+ )
target_include_directories(tinyusb_common_base INTERFACE
- ${TOP}/src
- )
+ ${TOP}/src
+ )
if(DEFINED LOG)
set(TINYUSB_DEBUG_LEVEL ${LOG})
@@ -48,9 +54,9 @@ else ()
endif()
target_compile_definitions(tinyusb_common_base INTERFACE
- CFG_TUSB_MCU=OPT_MCU_RP2040
- CFG_TUSB_OS=${TINYUSB_OPT_OS}
- CFG_TUSB_DEBUG=${TINYUSB_DEBUG_LEVEL}
+ CFG_TUSB_MCU=OPT_MCU_RP2040
+ CFG_TUSB_OS=${TINYUSB_OPT_OS}
+ CFG_TUSB_DEBUG=${TINYUSB_DEBUG_LEVEL}
)
target_link_libraries(tinyusb_common_base INTERFACE