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 part_name = "tex-hyphen" 21 install_enable = false 22 sources = 23 [ "$hyphen_root/ohos/src/hyphen-build/hyphen_pattern_processor.cpp" ] 24 external_deps = [ "icu:shared_icuuc" ] 25} 26 27dep_list = [] 28 29foreach(tex_source, tex_source_config) { 30 language = tex_source.language 31 hpb_file = "$target_out_dir/hpb_out/$language.hpb" 32 33 action("tex_hyphen_hpb_action_$language") { 34 script = "$hyphen_root/ohos/build/generate_hpb.py" 35 tex_base_output_path = 36 get_label_info(":hpb_transform(${host_toolchain})", "root_out_dir") 37 sources = [ tex_source.file_path ] 38 outputs = [ hpb_file ] 39 args = [ 40 rebase_path(tex_base_output_path) + 41 "/thirdparty/tex-hyphen/hpb_transform", 42 rebase_path(sources[0], root_build_dir), 43 rebase_path("$target_out_dir/hpb_out", root_build_dir), 44 ] 45 public_deps = [ ":hpb_transform(${host_toolchain})" ] 46 } 47 48 target_name = get_path_info(hpb_file, "name") 49 ohos_prebuilt_etc(target_name) { 50 source = hpb_file 51 module_install_dir = "usr/ohos_hyphen_data" 52 subsystem_name = "thirdparty" 53 part_name = "tex-hyphen" 54 deps = [ ":tex_hyphen_hpb_action_$language" ] 55 } 56 dep_list += [ ":" + target_name ] 57} 58 59group("hyphenation_patterns") { 60 deps = dep_list 61} 62