-
Notifications
You must be signed in to change notification settings - Fork 902
/
Copy pathCMakeLists.txt
58 lines (55 loc) · 1.96 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
pico_add_library(example_lwip_http_util NOFLAG)
target_sources(example_lwip_http_util INTERFACE
${CMAKE_CURRENT_LIST_DIR}/example_http_client_util.c
)
pico_mirrored_target_link_libraries(example_lwip_http_util INTERFACE
pico_lwip_http
pico_lwip_mbedtls
pico_mbedtls
)
target_include_directories(example_lwip_http_util INTERFACE
${CMAKE_CURRENT_LIST_DIR}
)
add_executable(picow_http_client
picow_http_client.c
)
target_compile_definitions(picow_http_client PRIVATE
WIFI_SSID=\"${WIFI_SSID}\"
WIFI_PASSWORD=\"${WIFI_PASSWORD}\"
)
target_include_directories(picow_http_client PRIVATE
${CMAKE_CURRENT_LIST_DIR}
${CMAKE_CURRENT_LIST_DIR}/.. # for our common lwipopts and mbedtls_config
)
target_link_libraries(picow_http_client
pico_cyw43_arch_lwip_threadsafe_background
example_lwip_http_util
pico_stdlib
)
pico_add_extra_outputs(picow_http_client)
add_executable(picow_http_client_verify
picow_http_verify.c
)
target_compile_definitions(picow_http_client_verify PRIVATE
WIFI_SSID=\"${WIFI_SSID}\"
WIFI_PASSWORD=\"${WIFI_PASSWORD}\"
# By default verification is optional (MBEDTLS_SSL_VERIFY_OPTIONAL)
# Make it required for this test
ALTCP_MBEDTLS_AUTHMODE=MBEDTLS_SSL_VERIFY_REQUIRED
)
target_include_directories(picow_http_client_verify PRIVATE
${CMAKE_CURRENT_LIST_DIR}
${CMAKE_CURRENT_LIST_DIR}/.. # for our common lwipopts and mbedtls_config
)
target_link_libraries(picow_http_client_verify
pico_cyw43_arch_lwip_threadsafe_background
example_lwip_http_util
pico_stdlib
)
pico_add_extra_outputs(picow_http_client_verify)
# 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"
)