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_arcscrollbar_abc") { 24 src_js = rebase_path("arkui_arcscrollbar.js") 25 dst_file = rebase_path(target_out_dir + "/arkui_arcscrollbar.abc") 26 in_puts = [ "arkui_arcscrollbar.js" ] 27 out_puts = [ target_out_dir + "/arkui_arcscrollbar.abc" ] 28 extra_args = [ "--module" ] 29} 30 31gen_obj("arkui_arcscrollbar_abc") { 32 input = get_label_info(":gen_arkui_arcscrollbar_abc", "target_out_dir") + 33 "/arkui_arcscrollbar.abc" 34 output = target_out_dir + "/arkui_arcscrollbar_abc.o" 35 if (use_mac || use_mingw_win || use_linux || target_os == "ios") { 36 output = target_out_dir + "arkui_arcscrollbar_abc.c" 37 } 38 snapshot_dep = [ ":gen_arkui_arcscrollbar_abc" ] 39} 40 41ohos_shared_library("arcscrollbar") { 42 defines = [ "USE_ARK_ENGINE" ] 43 sources = [ 44 "${component_ext_path}/arc_scroll_bar/arc_scroll_bar_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_scroll_bar/", 51 "${ace_root}/frameworks", 52 "$root_out_dir/arkui/framework", 53 ] 54 include_dirs += additional_include_dirs 55 56 deps = [ 57 ":gen_obj_src_arkui_arcscrollbar_abc", 58 "$ace_root/build:libace_compatible", 59 ] 60 61 external_deps = [ 62 "bounds_checking_function:libsec_static", 63 "ets_runtime:libark_jsruntime", 64 "hilog:libhilog", 65 "napi:ace_napi", 66 ] 67 68 if (!use_mac) { 69 ldflags = [ "-Wl,--gc-sections" ] 70 } 71 72 cflags = [ 73 "-fvisibility=hidden", 74 "-fdata-sections", 75 "-ffunction-sections", 76 "-Os", 77 ] 78 79 cflags_cc = [ 80 "-fvisibility-inlines-hidden", 81 "-Os", 82 ] 83 84 if (use_mingw_win || use_linux) { 85 cflags_cc += [ "-std=c++17" ] 86 defines += ["_USE_MATH_DEFINES"] 87 } 88 89 relative_install_dir = "module/arkui" 90 subsystem_name = ace_engine_subsystem 91 part_name = ace_engine_part 92} 93