-
Notifications
You must be signed in to change notification settings - Fork 908
/
Copy pathCMakeLists.txt
55 lines (53 loc) · 2.29 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
# This example is disabled as mbedtls uses too much stack, and Freertos SMP is problematic with
# pico_cyw43_arch_lwip_threadsafe_background (nosys), where WiFi and LwIP activity is performed in an IRQ.
# Prefer to use pico_cyw43_arch_lwip_sys_freertos instead, where WiFi and LwIP activity is performed in a thread.
if (0)
add_executable(picow_freertos_http_client_nosys
picow_freertos_http_client.c
)
target_compile_definitions(picow_freertos_http_client_nosys PRIVATE
WIFI_SSID=\"${WIFI_SSID}\"
WIFI_PASSWORD=\"${WIFI_PASSWORD}\"
ALTCP_MBEDTLS_AUTHMODE=MBEDTLS_SSL_VERIFY_REQUIRED
)
target_include_directories(picow_freertos_http_client_nosys PRIVATE
${CMAKE_CURRENT_LIST_DIR}
${CMAKE_CURRENT_LIST_DIR}/.. # for our common FreeRTOSConfig
${CMAKE_CURRENT_LIST_DIR}/../.. # for our common lwipopts and mbedtls_config
)
target_link_libraries(picow_freertos_http_client_nosys
pico_cyw43_arch_lwip_threadsafe_background
pico_stdlib
example_lwip_http_util
FreeRTOS-Kernel-Heap4 # FreeRTOS kernel and dynamic heap
)
pico_add_extra_outputs(picow_freertos_http_client_nosys)
endif()
add_executable(picow_freertos_http_client_sys
picow_freertos_http_client.c
)
target_compile_definitions(picow_freertos_http_client_sys PRIVATE
WIFI_SSID=\"${WIFI_SSID}\"
WIFI_PASSWORD=\"${WIFI_PASSWORD}\"
NO_SYS=0 # don't want NO_SYS (generally this would be in your lwipopts.h)
ALTCP_MBEDTLS_AUTHMODE=MBEDTLS_SSL_VERIFY_REQUIRED
CYW43_TASK_STACK_SIZE=2048
)
target_include_directories(picow_freertos_http_client_sys PRIVATE
${CMAKE_CURRENT_LIST_DIR}
${CMAKE_CURRENT_LIST_DIR}/.. # for our common FreeRTOSConfig
${CMAKE_CURRENT_LIST_DIR}/../.. # for our common lwipopts
)
target_link_libraries(picow_freertos_http_client_sys
pico_cyw43_arch_lwip_sys_freertos
pico_stdlib
example_lwip_http_util
FreeRTOS-Kernel-Heap4 # FreeRTOS kernel and dynamic heap
)
pico_add_extra_outputs(picow_freertos_http_client_sys)
# Ignore warnings from lwip code
set_source_files_properties(
${PICO_LWIP_PATH}/src/apps/altcp_tls/altcp_tls_mbedtls.c
PROPERTIES
COMPILE_OPTIONS "-Wno-unused-result"
)