-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmeson.build
83 lines (65 loc) · 2.07 KB
/
meson.build
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
project('tart', 'cpp',
version: '0.1',
default_options: [
'warning_level=3',
# 'b_lto=true',
'buildtype=minsize',
'cpp_std=c++20'])
objcopy = find_program('objcopy')
arch = 'user'
chip = get_option('platform')
includes = include_directories('include', 'include/compat')
sources = []
cpp_args = ['-fno-exceptions', '-fno-rtti', '-fno-threadsafe-statics',
'-DLIBASYNC_CUSTOM_PLATFORM', '-fno-use-cxa-atexit']
link_args = ['-lgcc']
link_depends = []
subdir('src/chip')
subdir('src/arch')
frigg = subproject('frigg', default_options: ['frigg_no_install=true'])
cxxshim = subproject('cxxshim')
libarch = subproject('libarch', default_options: ['install_headers=false'])
libasync = subproject('libasync')
frigg_dep = frigg.get_variable('frigg_dep')
cxxshim_dep = cxxshim.get_variable('cxxshim_dep')
cxxshim_coro_dep = cxxshim.get_variable('std_coroutine_dep')
if get_option('enc28j60-verbose')
cpp_args += ['-DENC28J60_VERBOSE']
endif
if get_option('enc28j60-tell-me-more')
cpp_args += ['-DENC28J60_TELL_ME_MORE']
endif
libarch_dep = libarch.get_variable('libarch_dep')
libasync_dep = libasync.get_variable('libasync_dep')
sources += [
files(
'src/lib/string.cpp',
'src/alloc.cpp',
# 'src/drivers/w25x.cpp',
# 'src/drivers/enc28j60.cpp',
#'src/net/arp.cpp',
# 'src/net/ipv4/icmp.cpp',
# 'src/net/ipv4/udp.cpp',
# 'src/net/ipv4/tcp.cpp',
'src/cxx-support.cpp',
'src/init.cpp',
'src/log.cpp'
)
]
tart_core_dep = declare_dependency(
dependencies: [frigg_dep, cxxshim_dep, cxxshim_coro_dep, libarch_dep, libasync_dep],
compile_args: cpp_args,
include_directories: [includes])
lib = static_library('tart', sources,
dependencies: tart_core_dep,
cpp_args: cpp_args,
link_args: link_args,
link_depends: link_depends,
pic: false)
subdir('drivers/')
tart_dep = declare_dependency(link_whole: lib,
dependencies: [tart_core_dep, rp2_gpio_dep, rp2_resets_dep, pl011_uart_dep, rp2_osc_dep, rp2_pll_dep, rp2_clk_dep, freestanding_startup_dep, rp2_stage1_dep],
link_args: link_args,
compile_args: cpp_args,
include_directories: [includes])
subdir('examples/hello')