Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
tcg: Build once for system and once for user-only
Create two static libraries for use by each execution mode.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
  • Loading branch information
rth7680 committed Jun 5, 2023
1 parent d31b840 commit 514fea9
Showing 1 changed file with 27 additions and 3 deletions.
30 changes: 27 additions & 3 deletions tcg/meson.build
@@ -1,3 +1,7 @@
if not get_option('tcg').allowed()
subdir_done()
endif

tcg_ss = ss.source_set()

tcg_ss.add(files(
Expand All @@ -14,8 +18,28 @@ tcg_ss.add(files(
if get_option('tcg_interpreter')
libffi = dependency('libffi', version: '>=3.0', required: true,
method: 'pkg-config')
specific_ss.add(libffi)
specific_ss.add(files('tci.c'))
tcg_ss.add(libffi)
tcg_ss.add(files('tci.c'))
endif

specific_ss.add_all(when: 'CONFIG_TCG', if_true: tcg_ss)
tcg_ss = tcg_ss.apply(config_host, strict: false)

libtcg_user = static_library('tcg_user',
tcg_ss.sources() + genh,
name_suffix: 'fa',
c_args: '-DCONFIG_USER_ONLY',
build_by_default: have_user)

tcg_user = declare_dependency(link_with: libtcg_user,
dependencies: tcg_ss.dependencies())
user_ss.add(tcg_user)

libtcg_softmmu = static_library('tcg_softmmu',
tcg_ss.sources() + genh,
name_suffix: 'fa',
c_args: '-DCONFIG_SOFTMMU',
build_by_default: have_system)

tcg_softmmu = declare_dependency(link_with: libtcg_softmmu,
dependencies: tcg_ss.dependencies())
softmmu_ss.add(tcg_softmmu)

0 comments on commit 514fea9

Please sign in to comment.