-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
73 lines (53 loc) · 2.6 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
68
69
70
71
72
73
cmake_minimum_required(VERSION 3.16)
set(PICO_BOARD pico_w)
include(pico-sdk/pico_sdk_init.cmake)
#include(pico_extras_import_optional.cmake)
project(pico_examples C CXX ASM)
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)
if (PICO_SDK_VERSION_STRING VERSION_LESS "1.3.0")
message(FATAL_ERROR "Raspberry Pi Pico SDK version 1.3.0 (or later) required. Your version is ${PICO_SDK_VERSION_STRING}")
endif()
set(PICO_EXAMPLES_PATH ${CMAKE_CURRENT_SOURCE_DIR})
set(PICO_LWIP_CORE_CODE ${PICO_EXAMPLES_PATH}/pico-sdk/lib/lwip/src/core/)
# Initialize the SDK
pico_sdk_init()
include(example_auto_set_url.cmake)
set(LWIP_DIR ${CMAKE_CURRENT_SOURCE_DIR}/pico-sdk/lib/lwip)
set (LWIP_INCLUDE_DIRS
"${LWIP_DIR}/src/include"
"${CMAKE_CURRENT_SOURCE_DIR}"
)
add_compile_options(-Wall
-Wno-format # int != int32_t as far as the compiler is concerned because gcc has int32_t as long int
-Wno-unused-function # we have some for the docs that aren't called
-Wno-maybe-uninitialized
)
set(cherry_dir ${CMAKE_CURRENT_LIST_DIR}/CherryUSB/)
include_directories(${CMAKE_CURRENT_LIST_DIR}
${CMAKE_CURRENT_LIST_DIR}/CherryUSB/class/cdc
${CMAKE_CURRENT_LIST_DIR}/CherryUSB/class/wireless
${CMAKE_CURRENT_LIST_DIR}/CherryUSB/common
${CMAKE_CURRENT_LIST_DIR}/CherryUSB/core
${CMAKE_CURRENT_LIST_DIR}/CherryUSB/port/rp2040
#lwip directory:-
${LWIP_INCLUDE_DIRS}
#lwipopts.h ke liye
${CMAKE_CURRENT_LIST_DIR}/src
#arch/cc.h ke liye:-
${CMAKE_CURRENT_LIST_DIR}/common
)
set(CONFIG_CHERRYUSB 1)
set(CONFIG_USB_DEVICE 1)
set(CONFIG_USB_DEVICE_RNDIS 1)
set(CONFIG_LWIP 1)
set(CONFIG_LWIP_HTTPSRV 1)
if("${CMAKE_BUILD_TYPE}" STREQUAL "")
SET(CMAKE_BUILD_TYPE flash_xip)
endif()
project(PicoPiFi)
include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src ${PICO_EXAMPLES_PATH}/pico-sdk/lib/lwip/src/include ${PICO_EXAMPLES_PATH}/pico-sdk/lib/tinyusb/hw/bsp/rp2040)
add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/src/main.c ${CMAKE_CURRENT_SOURCE_DIR}/src/lwip.c ${CMAKE_CURRENT_SOURCE_DIR}/src/wifi_tx.c ${CMAKE_CURRENT_SOURCE_DIR}/src/cdc_rndis_device.c ${CMAKE_CURRENT_LIST_DIR}/CherryUSB/port/rp2040/usb_dc_rp2040.c ${CMAKE_CURRENT_LIST_DIR}/CherryUSB/class/cdc/usbd_cdc.c ${CMAKE_CURRENT_LIST_DIR}/src/usbd_rndis.c ${CMAKE_CURRENT_LIST_DIR}/CherryUSB/core/usbd_core.c)
target_link_libraries(${PROJECT_NAME} PRIVATE pico_stdlib hardware_resets hardware_irq pico_lwip pico_multicore pico_cyw43_arch_none hardware_flash hardware_sync hardware_dma)
pico_add_extra_outputs(${PROJECT_NAME})
target_compile_definitions(${PROJECT_NAME} PRIVATE CYW43_SLEEP_CHECK_MS=3)