From d1985fd87bdbe7cad295f0c52fe5958152be9c51 Mon Sep 17 00:00:00 2001 From: liujia178 Date: Thu, 9 May 2024 09:43:53 +0800 Subject: [PATCH] fix decimal ABCcode and install path Signed-off-by: liujia178 --- BUILD.gn | 14 ++++++-------- decimal.cpp | 6 +++--- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index 1cc29e4..33f2731 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -36,16 +36,14 @@ gen_js_obj("decimal_mjs") { ohos_shared_library("decimal") { sources = [ "decimal.cpp" ] - deps = [ + deps = [ ":decimal_abc", - ":decimal_mjs" - ] - - external_deps = [ - "napi:ace_napi", + ":decimal_mjs", ] - relative_install_dir = "module/arkts" + external_deps = [ "napi:ace_napi" ] + + relative_install_dir = "module/arkts/math" part_name = "decimal.js" subsystem_name = "thirdparty" -} \ No newline at end of file +} diff --git a/decimal.cpp b/decimal.cpp index 64a1650..c5e0997 100644 --- a/decimal.cpp +++ b/decimal.cpp @@ -15,7 +15,7 @@ extern const char _binary_decimal_abc_end[]; // Napi get mjs code function extern "C" __attribute__((visibility("default"))) -void NAPI_arkts_Decimal_GetMJSCode(const char **buf, int *buflen) +void NAPI_arkts_math_Decimal_GetMJSCode(const char **buf, int *buflen) { if (buf != nullptr) { *buf = _binary_decimal_mjs_start; @@ -27,7 +27,7 @@ void NAPI_arkts_Decimal_GetMJSCode(const char **buf, int *buflen) // Napi get abc code function extern "C" __attribute__((visibility("default"))) -void NAPI_arkts_Decimal_GetABCCode(const char **buf, int *buflen) +void NAPI_arkts_math_Decimal_GetABCCode(const char **buf, int *buflen) { if (buf != nullptr) { *buf = _binary_decimal_abc_start; @@ -42,7 +42,7 @@ void NAPI_arkts_Decimal_GetABCCode(const char **buf, int *buflen) */ static napi_module DecimalModule = { .nm_filename = nullptr, - .nm_modname = "arkts.Decimal", + .nm_modname = "arkts.math.Decimal", }; extern "C" __attribute__((constructor)) void DecimalRegisterModule(void) { -- Gitee