49 lines
1.3 KiB
CMake
49 lines
1.3 KiB
CMake
|
|
cmake_minimum_required(VERSION 3.13)
|
||
|
|
|
||
|
|
add_library(limen STATIC
|
||
|
|
src/arp.cpp
|
||
|
|
src/dispatch.cpp
|
||
|
|
src/flash.cpp
|
||
|
|
src/handlers.cpp
|
||
|
|
src/icmp.cpp
|
||
|
|
src/igmp.cpp
|
||
|
|
src/ipv4.cpp
|
||
|
|
src/net.cpp
|
||
|
|
src/test_handlers.cpp
|
||
|
|
src/udp.cpp
|
||
|
|
w6300/w6300.cpp
|
||
|
|
)
|
||
|
|
|
||
|
|
target_include_directories(limen PUBLIC
|
||
|
|
${CMAKE_CURRENT_SOURCE_DIR}/include
|
||
|
|
${CMAKE_CURRENT_SOURCE_DIR}/w6300
|
||
|
|
)
|
||
|
|
|
||
|
|
target_compile_options(limen PRIVATE -Wall -Wextra -Wno-unused-parameter)
|
||
|
|
|
||
|
|
target_link_libraries(limen PUBLIC
|
||
|
|
pico_stdlib
|
||
|
|
pico_sha256
|
||
|
|
pico_unique_id
|
||
|
|
hardware_pio
|
||
|
|
hardware_spi
|
||
|
|
hardware_dma
|
||
|
|
hardware_clocks
|
||
|
|
)
|
||
|
|
|
||
|
|
pico_generate_pio_header(limen ${CMAKE_CURRENT_SOURCE_DIR}/w6300/qspi.pio)
|
||
|
|
|
||
|
|
set(LIMEN_PARTITION_TABLE ${CMAKE_CURRENT_SOURCE_DIR}/partition_table.json CACHE INTERNAL "")
|
||
|
|
|
||
|
|
# Apply per-executable limen setup: pt embed, binary hash, extras, copy-to-ram,
|
||
|
|
# version, disable stdio. Callers still do pico_add_executable + link-libs.
|
||
|
|
function(limen_configure_executable target)
|
||
|
|
pico_enable_stdio_usb(${target} 0)
|
||
|
|
pico_enable_stdio_uart(${target} 0)
|
||
|
|
pico_set_binary_type(${target} copy_to_ram)
|
||
|
|
pico_hash_binary(${target})
|
||
|
|
pico_embed_pt_in_binary(${target} ${LIMEN_PARTITION_TABLE})
|
||
|
|
pico_add_extra_outputs(${target})
|
||
|
|
target_compile_options(${target} PRIVATE -Wall -Wextra -Wno-unused-parameter)
|
||
|
|
endfunction()
|