summaryrefslogtreecommitdiff
path: root/libhw/CMakeLists.txt
blob: 36276418c93c8fe747a83d240b6f6ca726bfcb8f (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
# libhw/CMakeLists.txt - TODO
#
# Copyright (C) 2024  Luke T. Shumaker <lukeshu@lukeshu.com>
# SPDX-License-Identifier: AGPL-3.0-or-later

add_library(libhw INTERFACE)
target_include_directories(libhw SYSTEM INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/common_include)
target_link_libraries(libhw INTERFACE
	libcr
	libcr_ipc
	libmisc
)

target_sources(libhw INTERFACE
	common_alarmclock.c
)

if (PICO_PLATFORM STREQUAL "rp2040")
	target_include_directories(libhw SYSTEM INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/rp2040_include)
	target_sources(libhw INTERFACE
		rp2040_hwtimer.c
		rp2040_hwspi.c
		w5500.c
	)
	target_link_libraries(libhw INTERFACE
		hardware_gpio
		hardware_irq
		hardware_spi
		hardware_timer
	)
endif()

if (PICO_PLATFORM STREQUAL "host")
	target_include_directories(libhw SYSTEM INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/host_include)
	target_sources(libhw INTERFACE
		host_util.c
		host_alarmclock.c
		host_net.c
	)
endif()