summaryrefslogtreecommitdiff
path: root/src/CMakeLists.txt
blob: 9084cbb55d966900d6730f160e11ca6687c05d23 (plain)
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
set (inc ${CMAKE_SOURCE_DIR}/include)

add_library (usbhost
	${USART_HELPERS}
	${inc}/usbh_core.h
	${inc}/usbh_driver_ac_midi.h
	${inc}/usbh_driver_gp_xbox.h
	${inc}/usbh_driver_hid.h
	${inc}/usbh_driver_hub.h
	${inc}/usbh_lld_stm32f4.h
	${inc}/driver/usbh_device_driver.h
	${inc}/usbh_config.h

	usbh_core.c
	usbh_driver_ac_midi.c
	usbh_driver_ac_midi_private.h
	usbh_driver_gp_xbox.c
	usbh_driver_hid.c
	usbh_driver_hub.c
	usbh_driver_hub_private.h
	usbh_lld_stm32f4.c
    usart_helpers.c
    tinyprintf.c
    cobs.c
    noise.c
    packet_interface.c
    adjectives.c
    nouns.c
    hid_keycodes.c
)

add_subdirectory (crypto)

add_definitions (
    -DBLAKE2S_USE_VECTOR_MATH=0
)

target_link_libraries (usbhost
    noise
	${LIBOPENCM3_LIB}
)

add_executable (demo
    rand_stm32.c
	demo.c
)

target_link_libraries (demo
	usbhost
    noise
)

add_custom_command (TARGET demo
	POST_BUILD
	COMMAND ${CMAKE_OBJCOPY} -Oihex $<TARGET_FILE:demo> ${CMAKE_BINARY_DIR}/demo.hex
	COMMENT "Generating output files: ${CMAKE_BINARY_DIR}/demo.hex"
)

add_custom_command (TARGET demo
	POST_BUILD
	COMMAND ${CMAKE_SIZE} $<TARGET_FILE:demo>
	COMMENT "Calculating size of the binary"
)

add_custom_command (TARGET usbhost
	POST_BUILD
	COMMENT "Calculating size of the library"
	COMMAND ${CMAKE_SIZE} $<TARGET_FILE:usbhost>
)