diff --git a/adapter/uhdf2/hdi/BUILD.gn b/adapter/uhdf2/hdi/BUILD.gn index 555ec83eea7662a67ee6b589c606d974c79e3afb..df7f37edcb72f2157890ab936f5e135efc31b866 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 1b1aca94e205efcfd55f87c740c8bcbc81335f6d..7d4c04e0ba20ef776ddec05dbc1c5f3b0a0df0ae 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 165b4b9959c517e92e6418bd9f614d61d662880c..176c796f7d1d4f6e95f76d775e47317daf985c7a 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"