summaryrefslogtreecommitdiff
path: root/examples/device/board_test
diff options
context:
space:
mode:
authorhathach <[email protected]>2021-01-24 00:44:17 +0700
committerhathach <[email protected]>2021-01-24 00:44:17 +0700
commit959a94b98d020ee2f6a05e36be56c1618dd6ed78 (patch)
treeab0fe01d362ce176f3e69217b1e5bb036b04bc27 /examples/device/board_test
parentffad6eaf80900a858e22378e68de8b21b96c769e (diff)
rp2040 audio_test compile
Diffstat (limited to 'examples/device/board_test')
-rw-r--r--examples/device/board_test/CMakeLists.txt17
1 files changed, 13 insertions, 4 deletions
diff --git a/examples/device/board_test/CMakeLists.txt b/examples/device/board_test/CMakeLists.txt
index e8cab1656..c405c2eae 100644
--- a/examples/device/board_test/CMakeLists.txt
+++ b/examples/device/board_test/CMakeLists.txt
@@ -1,5 +1,3 @@
-cmake_minimum_required(VERSION 3.5)
-
# use directory name for project id
get_filename_component(PROJECT ${CMAKE_CURRENT_SOURCE_DIR} NAME)
@@ -9,22 +7,33 @@ get_filename_component(TOP "${TOP}" REALPATH)
# Check for -DFAMILY=
if(FAMILY STREQUAL "esp32s2")
+ cmake_minimum_required(VERSION 3.5)
include(${TOP}/hw/bsp/${FAMILY}/family.cmake)
project(${PROJECT})
elseif(FAMILY STREQUAL "rp2040")
+ cmake_minimum_required(VERSION 3.12)
+ set(PICO_SDK_PATH ${TOP}/hw/mcu/raspberrypi/pico-sdk)
+ include(${PICO_SDK_PATH}/pico_sdk_init.cmake)
+ project(${PROJECT})
+ pico_sdk_init()
+ add_executable(${PROJECT})
+
include(${TOP}/hw/bsp/${FAMILY}/family.cmake)
# Example source
target_sources(${PROJECT} PUBLIC
- src/main.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
)
# Example include
target_include_directories(${PROJECT} PUBLIC
- src
+ ${CMAKE_CURRENT_SOURCE_DIR}/src
)
+ target_link_libraries(${PROJECT} pico_stdlib)
+ pico_add_extra_outputs(${PROJECT})
+
else()
message(FATAL_ERROR "Invalid FAMILY specified")
endif()