• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2024 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6#     http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14import("//build/ohos.gni")
15import("//third_party/tex-hyphen/tex-hyphen.gni")
16
17ohos_executable("hpb_transform") {
18  cflags_cc = [ "-std=c++17" ]
19  output_name = "hpb_transform"
20  install_enable = false
21  sources =
22      [ "$hyphen_root/ohos/src/hyphen-build/hyphen_pattern_processor.cpp" ]
23  external_deps = [ "icu:shared_icuuc" ]
24  part_name = "tex-hyphen"
25  subsystem_name = "thirdparty"
26}
27
28dep_list = []
29
30foreach(tex_source, tex_source_config) {
31  language = tex_source.language
32  hpb_file = "$target_out_dir/hpb_out/$language.hpb"
33
34  action("tex_hyphen_hpb_action_$language") {
35    script = "$hyphen_root/ohos/build/generate_hpb.py"
36    tex_base_output_path =
37        get_label_info(":hpb_transform(${host_toolchain})", "root_out_dir")
38    sources = [ tex_source.file_path ]
39    outputs = [ hpb_file ]
40    args = [
41      rebase_path(tex_base_output_path) +
42          "/thirdparty/tex-hyphen/hpb_transform",
43      rebase_path(sources[0], root_build_dir),
44      rebase_path("$target_out_dir/hpb_out", root_build_dir),
45    ]
46    public_deps = [ ":hpb_transform(${host_toolchain})" ]
47  }
48
49  target_name = get_path_info(hpb_file, "name")
50  ohos_prebuilt_etc(target_name) {
51    source = hpb_file
52    module_install_dir = "usr/ohos_hyphen_data"
53    subsystem_name = "thirdparty"
54    part_name = "tex-hyphen"
55    deps = [ ":tex_hyphen_hpb_action_$language" ]
56  }
57  dep_list += [ ":" + target_name ]
58}
59
60group("hyphenation_patterns") {
61  deps = dep_list
62}
63