在 2024/1/5 下午3:58, Tianrui Zhao 写道:
> Add kvm.c into meson.build to compile it when kvm
> is configed. Meanwhile in meson.build, we set the
> kvm_targets to loongarch64-softmmu when the cpu is
> loongarch. And fix the compiling error when config
> is enable-kvm,disable-tcg.
>
> Signed-off-by: Tianrui Zhao <zhaotianrui@loongson.cn>
> Signed-off-by: xianglai li <lixianglai@loongson.cn>
> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
> ---
> meson.build | 2 ++
> target/loongarch/kvm/meson.build | 1 +
> target/loongarch/meson.build | 1 +
> 3 files changed, 4 insertions(+)
> create mode 100644 target/loongarch/kvm/meson.build
Reviewed-by: Song Gao <gaosong@loongson.cn>
Thanks.
Song Gao
> diff --git a/meson.build b/meson.build
> index 445f2b7c2b..0c62b4156d 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -114,6 +114,8 @@ elif cpu in ['riscv32']
> kvm_targets = ['riscv32-softmmu']
> elif cpu in ['riscv64']
> kvm_targets = ['riscv64-softmmu']
> +elif cpu in ['loongarch64']Reviewed-by: Song Gao <gaosong@loongson.cn>
> + kvm_targets = ['loongarch64-softmmu']
> else
> kvm_targets = []
> endif
> diff --git a/target/loongarch/kvm/meson.build b/target/loongarch/kvm/meson.build
> new file mode 100644
> index 0000000000..2266de6ca9
> --- /dev/null
> +++ b/target/loongarch/kvm/meson.build
> @@ -0,0 +1 @@
> +loongarch_ss.add(when: 'CONFIG_KVM', if_true: files('kvm.c'))
> diff --git a/target/loongarch/meson.build b/target/loongarch/meson.build
> index 18e8191e2b..7f86caf373 100644
> --- a/target/loongarch/meson.build
> +++ b/target/loongarch/meson.build
> @@ -31,3 +31,4 @@ loongarch_ss.add_all(when: 'CONFIG_TCG', if_true: [loongarch_tcg_ss])
>
> target_arch += {'loongarch': loongarch_ss}
> target_system_arch += {'loongarch': loongarch_system_ss}
> +subdir('kvm')