-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
105 lines (81 loc) · 2.25 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
cmake_minimum_required(VERSION 3.13)
# Set the C standard
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)
include($ENV{PICO_SDK_PATH}/pico_sdk_init.cmake)
project(lodgenet_gc_adapter_rp2040 C CXX ASM)
pico_sdk_init()
include_directories(
include
common/include
common/include/devices
common/include/generated
common/include/switch
common/include/usb
common/include/utilities
common/include/ll
)
add_executable(${PROJECT_NAME}
main.c
common/utilities/rgb.c
common/utilities/joybus.c
common/utilities/interval.c
common/ll/adapter_ll_rp2040.c
common/usb/desc_bos.c
common/adapter.c
common/adapter_tusb.c
common/adapter_defines.c
common/adapter_settings.c
common/usb/xinput_driver.c
common/usb/ginput_driver.c
common/switch/switch_analog.c
common/switch/switch_commands.c
common/switch/switch_spi.c
common/devices/gcinput.c
common/devices/swpro.c
common/devices/webusb.c
common/devices/xinput.c
)
#file(MAKE_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/include/generated)
#pico_generate_pio_header(${PROJECT_NAME} ${CMAKE_CURRENT_LIST_DIR}/pio/ws2812.pio OUTPUT_DIR ${CMAKE_CURRENT_LIST_DIR}/include/generated)
#pico_generate_pio_header(${PROJECT_NAME} ${CMAKE_CURRENT_LIST_DIR}/pio/joybus.pio OUTPUT_DIR ${CMAKE_CURRENT_LIST_DIR}/include/generated)
target_compile_definitions(${PROJECT_NAME}
PRIVATE
PICO_XOSC_STARTUP_DELAY_MULTIPLIER=64
ADAPTER_MCU_TYPE=1
#PICO_DEFAULT_BOOT_STAGE2=boot2_generic_03h
#PICO_FLASH_SPI_CLKDIV=8
)
# Pull in pico libraries that we need
target_link_libraries(${PROJECT_NAME}
PRIVATE
pico_stdlib
pico_bootrom
pico_multicore
pico_platform
pico_rand
hardware_gpio
hardware_adc
hardware_flash
hardware_pio
hardware_dma
hardware_pwm
hardware_spi
hardware_sync
hardware_timer
hardware_irq
tinyusb_device
tinyusb_board
)
pico_enable_stdio_usb(${PROJECT_NAME} 0)
pico_enable_stdio_uart(${PROJECT_NAME} 0)
pico_add_extra_outputs(${PROJECT_NAME})
add_custom_command(TARGET ${PROJECT_NAME}
POST_BUILD
COMMAND ${CMAKE_COMMAND}
-DTARGET_NAME=${PROJECT_NAME}
-DTARGET_PATH=${CMAKE_CURRENT_SOURCE_DIR}
-P ${CMAKE_SOURCE_DIR}/manifest.cmake
COMMENT "Updating version in manifest.json"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)