xref: /openbmc/qemu/tcg/meson.build (revision 5915139aba1646220630596de30c673528e047c9)
1514fea9eSRichard Hendersonif not get_option('tcg').allowed()
2514fea9eSRichard Henderson   subdir_done()
3514fea9eSRichard Hendersonendif
4514fea9eSRichard Henderson
5104cc2c0SRichard Hendersontcg_ss = ss.source_set()
6104cc2c0SRichard Henderson
7104cc2c0SRichard Hendersontcg_ss.add(files(
8104cc2c0SRichard Henderson  'optimize.c',
95ff7258cSRichard Henderson  'region.c',
10104cc2c0SRichard Henderson  'tcg.c',
11104cc2c0SRichard Henderson  'tcg-common.c',
12104cc2c0SRichard Henderson  'tcg-op.c',
13a1429ca2SRichard Henderson  'tcg-op-ldst.c',
14104cc2c0SRichard Henderson  'tcg-op-gvec.c',
15104cc2c0SRichard Henderson  'tcg-op-vec.c',
16104cc2c0SRichard Henderson))
1722f15579SRichard Henderson
1822f15579SRichard Hendersonif get_option('tcg_interpreter')
1922f15579SRichard Henderson  libffi = dependency('libffi', version: '>=3.0', required: true,
20063d5119SPaolo Bonzini                      method: 'pkg-config')
21514fea9eSRichard Henderson  tcg_ss.add(libffi)
22514fea9eSRichard Henderson  tcg_ss.add(files('tci.c'))
2322f15579SRichard Hendersonendif
24104cc2c0SRichard Henderson
25327b75a4SIlya Leoshkevichtcg_ss.add(when: libdw, if_true: files('debuginfo.c'))
26327b75a4SIlya Leoshkevichif host_os == 'linux'
27327b75a4SIlya Leoshkevich  tcg_ss.add(files('perf.c'))
28327b75a4SIlya Leoshkevichendif
29327b75a4SIlya Leoshkevich
301220f581SPaolo Bonzinitcg_ss = tcg_ss.apply({})
31514fea9eSRichard Henderson
32514fea9eSRichard Hendersonlibtcg_user = static_library('tcg_user',
33514fea9eSRichard Henderson                             tcg_ss.sources() + genh,
3461306156SPaolo Bonzini                             dependencies: tcg_ss.dependencies(),
35514fea9eSRichard Henderson                             c_args: '-DCONFIG_USER_ONLY',
364c545a05SPaolo Bonzini                             build_by_default: false)
37514fea9eSRichard Henderson
38*414b180dSAkihiko Odakitcg_user = declare_dependency(objects: libtcg_user.extract_all_objects(recursive: false),
39*414b180dSAkihiko Odaki                              dependencies: tcg_ss.dependencies())
40514fea9eSRichard Hendersonuser_ss.add(tcg_user)
41514fea9eSRichard Henderson
427893e42dSPhilippe Mathieu-Daudélibtcg_system = static_library('tcg_system',
43514fea9eSRichard Henderson                                tcg_ss.sources() + genh,
4461306156SPaolo Bonzini                                dependencies: tcg_ss.dependencies(),
45514fea9eSRichard Henderson                                c_args: '-DCONFIG_SOFTMMU',
464c545a05SPaolo Bonzini                                build_by_default: false)
47514fea9eSRichard Henderson
48*414b180dSAkihiko Odakitcg_system = declare_dependency(objects: libtcg_system.extract_all_objects(recursive: false),
49*414b180dSAkihiko Odaki                                dependencies: tcg_ss.dependencies())
507893e42dSPhilippe Mathieu-Daudésystem_ss.add(tcg_system)
51