From f2b697106c3056c614ab9716e636aede93d1806a Mon Sep 17 00:00:00 2001 From: wawanala Date: Mon, 25 Dec 2023 11:06:00 +0800 Subject: [PATCH] add riscv64 Signed-off-by: wawanala --- adapter/uhdf2/hdi/BUILD.gn | 6 ++++-- adapter/uhdf2/test/unittest/load_vdi/BUILD.gn | 3 ++- interfaces/inner_api/utils/hdf_base.h | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/adapter/uhdf2/hdi/BUILD.gn b/adapter/uhdf2/hdi/BUILD.gn index 555ec83ee..df7f37edc 100644 --- a/adapter/uhdf2/hdi/BUILD.gn +++ b/adapter/uhdf2/hdi/BUILD.gn @@ -35,7 +35,8 @@ if (defined(ohos_lite)) { ohos_shared_library("libhdi") { output_extension = "z.so" - if (target_cpu == "arm64" || target_cpu == "x86_64") { + if (target_cpu == "arm64" || target_cpu == "x86_64" || + target_cpu == "riscv64") { defines = [ "__ARCH64__" ] } @@ -59,7 +60,8 @@ if (defined(ohos_lite)) { } } else { ohos_shared_library("libhdi") { - if (target_cpu == "arm64" || target_cpu == "x86_64") { + if (target_cpu == "arm64" || target_cpu == "x86_64" || + target_cpu == "riscv64") { defines = [ "__ARCH64__" ] } diff --git a/adapter/uhdf2/test/unittest/load_vdi/BUILD.gn b/adapter/uhdf2/test/unittest/load_vdi/BUILD.gn index 1b1aca94e..7d4c04e0b 100644 --- a/adapter/uhdf2/test/unittest/load_vdi/BUILD.gn +++ b/adapter/uhdf2/test/unittest/load_vdi/BUILD.gn @@ -21,7 +21,8 @@ ohos_unittest("hdf_load_vdi_test") { sources = [ "../../../../../framework/core/host/test/unittest/hdf_vdi_test.cpp" ] - if (target_cpu == "arm64" || target_cpu == "x86_64") { + if (target_cpu == "arm64" || target_cpu == "x86_64" || + target_cpu == "riscv64") { resource_config_file = "../../resource/load_vdi/arch64/ohos_test.xml" } else { resource_config_file = "../../resource/load_vdi/arch32/ohos_test.xml" diff --git a/interfaces/inner_api/utils/hdf_base.h b/interfaces/inner_api/utils/hdf_base.h index 165b4b995..176c796f7 100644 --- a/interfaces/inner_api/utils/hdf_base.h +++ b/interfaces/inner_api/utils/hdf_base.h @@ -125,7 +125,7 @@ typedef enum { /** * @brief Declares the full path of the HDF module library. */ -#if (defined(__aarch64__) || defined(__x86_64__)) +#if (defined(__aarch64__) || defined(__x86_64__)) || (defined(__riscv) && (__riscv_xlen == 64)) #define HDF_LIBRARY_FULL_PATH(x) "/vendor/lib64/" x ".z.so" #else #define HDF_LIBRARY_FULL_PATH(x) "/vendor/lib/" x ".z.so" -- Gitee