44 lines
1.2 KiB
CMake
44 lines
1.2 KiB
CMake
cmake_minimum_required(VERSION 3.13...3.27)
|
|
|
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
|
set(DEBUG_ON_PICO ON)
|
|
set(PICO_PLATFORM rp2350-arm-s)
|
|
set(target_proj dentachi)
|
|
|
|
# initialize pico-sdk from submodule
|
|
# note: this must happen before project()
|
|
include(pico-sdk/pico_sdk_init.cmake)
|
|
|
|
project(${target_proj} C CXX ASM)
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ffunction-sections -fdata-sections -Wl,--gc-sections")
|
|
set(CMAKE_C_STANDARD 11)
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
|
|
# initialize the Raspberry Pi Pico SDK
|
|
pico_sdk_init()
|
|
|
|
# rest of the project
|
|
add_executable(${target_proj}
|
|
main.c
|
|
u8g2_pico.c
|
|
tinyexpr.c
|
|
)
|
|
|
|
# Add u8g2 library for the graphical LCD
|
|
target_include_directories(${target_proj} PRIVATE u8g2/csrc)
|
|
file(GLOB U8G2_SRC u8g2/csrc/*.c)
|
|
add_library(u8g2 ${U8G2_SRC})
|
|
|
|
target_include_directories(${target_proj} PRIVATE ${CMAKE_CURRENT_LIST_DIR})
|
|
target_link_options(${target_proj} PRIVATE -Xlinker --print-memory-usage)
|
|
target_compile_options(${target_proj} PRIVATE -Wall -Wextra -DCFG_TUSB_DEBUG=1)
|
|
|
|
target_link_libraries(${target_proj} pico_stdlib hardware_spi u8g2)
|
|
|
|
# create map/bin/hex/uf2 file in addition to ELF.
|
|
pico_add_extra_outputs(${target_proj})
|
|
|
|
pico_enable_stdio_usb(${PROJECT_NAME} 1)
|
|
pico_enable_stdio_uart(${PROJECT_NAME} 0)
|