1# Copyright (C) 2023 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("//build/ohos/ace/ace.gni") 17import("../../../filemanagement_aafwk.gni") 18 19# compile .js to .abc. 20 21es2abc_gen_abc("gen_picker_abc") { 22 src_js = rebase_path("picker.js") 23 dst_file = rebase_path(target_out_dir + "/picker.abc") 24 in_puts = [ "picker.js" ] 25 out_puts = [ target_out_dir + "/picker.abc" ] 26 extra_args = [ "--module" ] 27} 28 29base_output_path = get_label_info(":picker_js", "target_out_dir") 30picker_obj_path = base_output_path + "/picker.o" 31gen_js_obj("picker_js") { 32 input = "picker.js" 33 output = picker_obj_path 34 dep = ":gen_picker_abc" 35} 36 37abc_output_path = get_label_info(":picker_abc", "target_out_dir") 38picker_abc_obj_path = abc_output_path + "/picker_abc.o" 39gen_js_obj("picker_abc") { 40 input = "$target_out_dir/picker.abc" 41 output = picker_abc_obj_path 42 dep = ":gen_picker_abc" 43} 44 45ohos_shared_library("picker") { 46 branch_protector_ret = "pac_ret" 47 ldflags = [ "-Wl" ] 48 49 include_dirs = [ "include" ] 50 51 sources = [ 52 "native_module_ohos_picker.cpp", 53 "src/modal_ui_callback.cpp", 54 "src/picker_n_exporter.cpp", 55 "src/picker_napi_utils.cpp", 56 ] 57 58 deps = [ 59 ":picker_abc", 60 ":picker_js", 61 ] 62 63 external_deps = [ 64 "ability_base:want", 65 "ability_base:zuri", 66 "ability_runtime:ability_context_native", 67 "ability_runtime:ability_manager", 68 "ability_runtime:abilitykit_native", 69 "ability_runtime:abilitykit_native", 70 "ability_runtime:app_context", 71 "ability_runtime:dataobs_manager", 72 "ability_runtime:napi_base_context", 73 "ability_runtime:napi_common", 74 "ability_runtime:runtime", 75 "ability_runtime:service_extension", 76 "ability_runtime:ui_extension", 77 "ace_engine:ace_uicontent", 78 "file_api:filemgmt_libhilog", 79 "file_api:filemgmt_libn", 80 "hilog:libhilog", 81 "ipc:ipc_napi", 82 "ipc:ipc_single", 83 "napi:ace_napi", 84 ] 85 86 if (picker_udmf_enabled) { 87 defines = [ "UDMF_ENABLED" ] 88 external_deps += [ "udmf:udmf_client" ] 89 } 90 91 sanitize = { 92 integer_overflow = true 93 ubsan = true 94 boundary_sanitize = true 95 cfi = true 96 cfi_cross_dso = true 97 debug = false 98 } 99 100 relative_install_dir = "module/file" 101 subsystem_name = "filemanagement" 102 part_name = "user_file_service" 103} 104 105ohos_shared_library("cj_picker_ffi") { 106 branch_protector_ret = "pac_ret" 107 ldflags = [ "-Wl" ] 108 109 include_dirs = [ "cj/include" ] 110 111 sources = [ "cj/src/cj_picker.cpp" ] 112 113 external_deps = [ 114 "ability_base:want", 115 "ability_base:zuri", 116 "ability_runtime:ability_context_native", 117 "ability_runtime:ability_manager", 118 "ability_runtime:abilitykit_native", 119 "ability_runtime:app_context", 120 "ability_runtime:dataobs_manager", 121 "ability_runtime:runtime", 122 "ability_runtime:service_extension", 123 "ability_runtime:ui_extension", 124 "ace_engine:ace_uicontent", 125 "file_api:filemgmt_libhilog", 126 "file_api:filemgmt_libn", 127 "hilog:libhilog", 128 "napi:cj_bind_ffi", 129 "napi:cj_bind_native", 130 ] 131 132 sanitize = { 133 integer_overflow = true 134 ubsan = true 135 boundary_sanitize = true 136 cfi = true 137 cfi_cross_dso = true 138 debug = false 139 } 140 141 innerapi_tags = [ "platformsdk" ] 142 subsystem_name = "filemanagement" 143 part_name = "user_file_service" 144} 145