diff --git a/icu.gni b/icu.gni index 8756c1be..21212b94 100644 --- a/icu.gni +++ b/icu.gni @@ -17,4 +17,6 @@ declare_args() { icu_support_libbegetutil = true distro_tzdata_dir = "\"/system/etc/tzdata_distro\"" system_tzdata_dir = "\"/system/etc/icu_tzdata\"" + icu_dat_name = "icudt72l" + icu_data_filter_dir = "full" } diff --git a/icu4c/BUILD.gn b/icu4c/BUILD.gn index a4defcbc..22caac6a 100644 --- a/icu4c/BUILD.gn +++ b/icu4c/BUILD.gn @@ -54,6 +54,15 @@ ohos_static_library("static_icustubdata") { subsystem_name = "thirdparty" } +ohos_prebuilt_etc("ohos_icudat") { + source = "$root_out_dir/thirdparty/icu/out/$icu_dat_name.dat" + + deps = [ "//third_party/icu/ohos_icu4c:pkg_icudata" ] + module_install_dir = "usr/ohos_icu/" + part_name = "icu" + subsystem_name = "thirdparty" +} + icu_common_source = [ "//third_party/icu/icu4c/source/common/ubiditransform.cpp", "//third_party/icu/icu4c/source/common/locutil.cpp", @@ -526,7 +535,10 @@ ohos_shared_library("shared_icuuc") { "SYSTEM_TZDATA_DIR=${system_tzdata_dir}", ] sources = icu_common_source - deps = [ ":static_icustubdata" ] + deps = [ + ":ohos_icudat", + ":static_icustubdata", + ] cflags_cc = [ "-O3", "-W", diff --git a/ohos_icu4c/BUILD.gn b/ohos_icu4c/BUILD.gn index 8a9780d4..0cd88b0c 100644 --- a/ohos_icu4c/BUILD.gn +++ b/ohos_icu4c/BUILD.gn @@ -15,9 +15,6 @@ import("//build/ohos.gni") import("//build/ohos/ndk/ndk.gni") import("//third_party/icu/icu.gni") -icu_dat_name = "icudt72l" -icu_data_filter_dir = "full" - ohos_shared_library("icundk") { ldflags = [ "-shared", @@ -32,7 +29,6 @@ ohos_shared_library("icundk") { sources = [ "src/icu_addon.cpp" ] deps = [ - ":ohos_icudat", "//third_party/icu/icu4c:shared_icui18n", "//third_party/icu/icu4c:shared_icuuc", ] @@ -75,16 +71,3 @@ action("pkg_icudata") { ] outputs = [ "$root_out_dir/thirdparty/icu/out/$icu_dat_name.dat" ] } - -ohos_prebuilt_etc("ohos_icudat") { - if ("${product_name}" == "ohcore") { - source = "//third_party/icu/ohos_icu4j/data/icudt68l.dat" - } else { - source = "$root_out_dir/thirdparty/icu/out/$icu_dat_name.dat" - } - - deps = [ ":pkg_icudata" ] - module_install_dir = "usr/ohos_icu/" - part_name = "icu" - subsystem_name = "thirdparty" -}