target/loongarch: Add loongarch kvm into meson build

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>
Reviewed-by: Song Gao <gaosong@loongson.cn>
Message-Id: <20240105075804.1228596-10-zhaotianrui@loongson.cn>
Signed-off-by: Song Gao <gaosong@loongson.cn>
This commit is contained in:
Tianrui Zhao 2024-01-05 15:58:04 +08:00 committed by Song Gao
parent 8dcbad5128
commit 714b03c125
3 changed files with 4 additions and 0 deletions

View File

@ -229,6 +229,8 @@ elif cpu in ['riscv32']
kvm_targets = ['riscv32-softmmu']
elif cpu in ['riscv64']
kvm_targets = ['riscv64-softmmu']
elif cpu in ['loongarch64']
kvm_targets = ['loongarch64-softmmu']
else
kvm_targets = []
endif

View File

@ -0,0 +1 @@
loongarch_ss.add(when: 'CONFIG_KVM', if_true: files('kvm.c'))

View File

@ -18,3 +18,4 @@ subdir('tcg')
target_arch += {'loongarch': loongarch_ss}
target_system_arch += {'loongarch': loongarch_system_ss}
subdir('kvm')