xref: /openbmc/qemu/gdbstub/meson.build (revision ed75658a)
1#
2# The main gdbstub still relies on per-build definitions of various
3# types. The bits pushed to system/user.c try to use guest agnostic
4# types such as hwaddr.
5#
6
7# We need to build the core gdb code via a library to be able to tweak
8# cflags so:
9
10gdb_user_ss = ss.source_set()
11gdb_system_ss = ss.source_set()
12
13# We build two versions of gdbstub, one for each mode
14gdb_user_ss.add(files('gdbstub.c', 'user.c'))
15gdb_system_ss.add(files('gdbstub.c', 'system.c'))
16
17gdb_user_ss = gdb_user_ss.apply({})
18gdb_system_ss = gdb_system_ss.apply({})
19
20libgdb_user = static_library('gdb_user',
21                             gdb_user_ss.sources() + genh,
22                             name_suffix: 'fa',
23                             c_args: '-DCONFIG_USER_ONLY',
24                             build_by_default: false)
25
26libgdb_system = static_library('gdb_system',
27                                gdb_system_ss.sources() + genh,
28                                name_suffix: 'fa',
29                                build_by_default: false)
30
31gdb_user = declare_dependency(link_whole: libgdb_user)
32user_ss.add(gdb_user)
33gdb_system = declare_dependency(link_whole: libgdb_system)
34system_ss.add(gdb_system)
35
36common_ss.add(files('syscalls.c'))
37
38# The user-target is specialised by the guest
39specific_ss.add(when: 'CONFIG_USER_ONLY', if_true: files('user-target.c'))
40