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/config/components/ets_frontend/es2abc_config.gni") 15import("//build/ohos.gni") 16import("//foundation/arkui/ace_engine/ace_config.gni") 17import("//foundation/arkui/ace_engine/build/ace_gen_obj.gni") 18 19component_ext_path = "${ace_root}/component_ext" 20 21additional_include_dirs = [ "${ace_root}" ] 22 23es2abc_gen_abc("gen_arkui_arcalphabetindexer_abc") { 24 src_js = rebase_path("arkui_arcalphabetindexer.js") 25 dst_file = rebase_path(target_out_dir + "/arkui_arcalphabetindexer.abc") 26 in_puts = [ "arkui_arcalphabetindexer.js" ] 27 out_puts = [ target_out_dir + "/arkui_arcalphabetindexer.abc" ] 28 extra_args = [ "--module" ] 29} 30 31gen_obj("arkui_arcalphabetindexer_abc") { 32 input = get_label_info(":gen_arkui_arcalphabetindexer_abc", 33 "target_out_dir") + "/arkui_arcalphabetindexer.abc" 34 output = target_out_dir + "arkui_arcalphabetindexer_abc.o" 35 if (use_mac || use_mingw_win || use_linux || target_os == "ios") { 36 output = target_out_dir + "arkui_arcalphabetindexer_abc.c" 37 } 38 snapshot_dep = [ ":gen_arkui_arcalphabetindexer_abc" ] 39} 40 41ohos_shared_library("arcalphabetindexer") { 42 defines = [ "USE_ARK_ENGINE" ] 43 sources = [ 44 "${component_ext_path}/arc_alphabet_indexer/arc_alphabet_indexer_napi.cpp", 45 "${component_ext_path}/ext_common/ext_napi_utils.cpp", 46 ] 47 48 include_dirs = [ 49 "${component_ext_path}/ext_common/", 50 "${component_ext_path}/arc_alphabet_indexer/", 51 "${ace_root}/frameworks", 52 "$root_out_dir/arkui/framework", 53 "${ace_root}/interfaces/inner_api/ace_kit/include", 54 ] 55 include_dirs += additional_include_dirs 56 57 external_deps = [ 58 "bounds_checking_function:libsec_static", 59 "hilog:libhilog", 60 "napi:ace_napi", 61 ] 62 63 deps = [ 64 ":gen_obj_src_arkui_arcalphabetindexer_abc", 65 "$ace_root/build:libace_compatible", 66 ] 67 68 if (!(use_mingw_win || use_mac || use_linux)) { 69 external_deps += [ "ets_runtime:libark_jsruntime" ] 70 } 71 72 if (!use_mac) { 73 ldflags = [ "-Wl,--gc-sections" ] 74 } 75 76 cflags = [ 77 "-fvisibility=hidden", 78 "-fdata-sections", 79 "-ffunction-sections", 80 "-Os", 81 ] 82 83 cflags_cc = [ 84 "-fvisibility-inlines-hidden", 85 "-Os", 86 ] 87 88 if (use_mingw_win || use_linux) { 89 cflags_cc += [ "-std=c++17" ] 90 defines += [ "_USE_MATH_DEFINES" ] 91 } 92 93 relative_install_dir = "module/arkui" 94 subsystem_name = ace_engine_subsystem 95 part_name = ace_engine_part 96} 97