-
Notifications
You must be signed in to change notification settings - Fork 44
/
CMakeLists.txt
68 lines (50 loc) · 2.22 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
cmake_minimum_required(VERSION 3.13)
# Pull in Pico SDK (must be before project)
include(pico_sdk_import.cmake)
project(command_line C CXX ASM)
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)
# add_compile_options(-Os) # Optimize for size (place before pico_sdk_init)
# Initialise the Pico SDK
pico_sdk_init()
add_subdirectory(../../src build)
# Add executable. Default name is the project name, version 0.1
add_executable(command_line
main.cpp
hw_config.c
data_log_demo.c
tests/bench.c
tests/simple.c
tests/app4-IO_module_function_checker.c
tests/big_file_test.c
tests/CreateAndVerifyExampleFiles.c
tests/ff_stdio_tests_with_cwd.c
)
# Add the standard library to the build
target_link_libraries(command_line pico_stdlib)
# target_compile_options(command_line PUBLIC -Wall -Wextra -Wno-unused-function -Wno-unused-parameter)
target_compile_options(command_line PUBLIC -Wall -Wextra -Wno-unused-parameter -fanalyzer)
# This program is useless without standard standard input and output.
# add_compile_definitions(USE_PRINTF USE_DBG_PRINTF)
add_compile_definitions(USE_PRINTF)
# Disable CRC checking for SPI-attached cards.
# add_compile_definitions(SD_CRC_ENABLED=0)
# Use Pico's LED to show drive activity.
# Ensure that PICO_DEFAULT_LED_PIN is set correctly.
# Note that Pico W uses GPIO 25 for SPI communication to the CYW43439.
# add_compile_definitions(USE_LED=1)
# target_compile_definitions(<TARGET> PRIVATE PARAM_ASSERTIONS_ENABLE_ALL=1)
add_compile_definitions(PARAM_ASSERTIONS_ENABLE_ALL=1)
set_property(TARGET command_line APPEND_STRING PROPERTY LINK_FLAGS "-Wl,--print-memory-usage")
pico_set_program_name(command_line "command_line")
pico_set_program_version(command_line "0.1")
# See 4.1. Serial input and output on Raspberry Pi Pico in Getting started with Raspberry Pi Pico (https://datasheets.raspberrypi.org/pico/getting-started-with-pico.pdf)
# and 2.7.1. Standard Input/Output (stdio) Support in Raspberry Pi Pico C/C++ SDK (https://datasheets.raspberrypi.org/pico/raspberry-pi-pico-c-sdk.pdf):
pico_enable_stdio_uart(command_line 1)
pico_enable_stdio_usb(command_line 1)
target_link_libraries(command_line
FatFs_SPI
hardware_clocks
hardware_adc
)
pico_add_extra_outputs(command_line)