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/config/components/ace_engine/ace_gen_obj.gni") 17import("//foundation/multimedia/av_session/config.gni") 18 19es2abc_gen_abc("gen_avpicker_abc") { 20 if (use_mingw_win || use_mac || use_linux) { 21 src_js = rebase_path("avpicker_mock.js") 22 dst_file = rebase_path(target_out_dir + "/avpicker.abc") 23 in_puts = [ "avpicker_mock.js" ] 24 out_puts = [ target_out_dir + "/avpicker.abc" ] 25 extra_args = [ "--module" ] 26 } else { 27 src_js = rebase_path("avpicker.js") 28 dst_file = rebase_path(target_out_dir + "/avpicker.abc") 29 in_puts = [ "avpicker.js" ] 30 out_puts = [ target_out_dir + "/avpicker.abc" ] 31 extra_args = [ "--module" ] 32 } 33} 34 35gen_js_obj("avpicker_abc") { 36 input = 37 get_label_info(":gen_avpicker_abc", "target_out_dir") + "/avpicker.abc" 38 output = target_out_dir + "/avpicker_abc.o" 39 dep = ":gen_avpicker_abc" 40} 41 42gen_obj("avpicker_abc_preview") { 43 input = 44 get_label_info(":gen_avpicker_abc", "target_out_dir") + "/avpicker.abc" 45 output = target_out_dir + "/avpicker_abc.c" 46 snapshot_dep = [ ":gen_avpicker_abc" ] 47} 48 49ohos_shared_library("avcastpicker") { 50 sources = [ "avpicker.cpp" ] 51 52 sanitize = { 53 cfi = true 54 cfi_cross_dso = true 55 debug = false 56 } 57 58 if (use_mingw_win || use_mac || use_linux) { 59 deps = [ ":gen_obj_src_avpicker_abc_preview" ] 60 } else { 61 deps = [ ":avpicker_abc" ] 62 } 63 defines = [] 64 if (use_mingw_win) { 65 defines += [ "WINDOWS_PLATFORM" ] 66 } else if (use_mac) { 67 defines += [ "MAC_PLATFORM" ] 68 } else if (use_linux) { 69 defines += [ "LINUX_PLATFORM" ] 70 } 71 72 external_deps = [ "napi:ace_napi" ] 73 74 relative_install_dir = "module/multimedia" 75 subsystem_name = "multimedia" 76 part_name = "av_session" 77} 78 79################################################################## 80 81es2abc_gen_abc("gen_avpickerparam_abc") { 82 if (use_mingw_win || use_mac || use_linux) { 83 src_js = rebase_path("avpickerparam_mock.js") 84 dst_file = rebase_path(target_out_dir + "/avpickerparam.abc") 85 in_puts = [ "avpickerparam_mock.js" ] 86 out_puts = [ target_out_dir + "/avpickerparam.abc" ] 87 extra_args = [ "--module" ] 88 } else { 89 src_js = rebase_path("avpickerparam.js") 90 dst_file = rebase_path(target_out_dir + "/avpickerparam.abc") 91 in_puts = [ "avpickerparam.js" ] 92 out_puts = [ target_out_dir + "/avpickerparam.abc" ] 93 extra_args = [ "--module" ] 94 } 95} 96 97gen_js_obj("avpickerparam_abc") { 98 input = get_label_info(":gen_avpickerparam_abc", "target_out_dir") + 99 "/avpickerparam.abc" 100 output = target_out_dir + "/avpickerparam_abc.o" 101 dep = ":gen_avpickerparam_abc" 102} 103 104gen_obj("avpickerparam_abc_preview") { 105 input = get_label_info(":gen_avpickerparam_abc", "target_out_dir") + 106 "/avpickerparam.abc" 107 output = target_out_dir + "/avpickerparam_abc.c" 108 snapshot_dep = [ ":gen_avpickerparam_abc" ] 109} 110 111ohos_shared_library("avcastpickerparam") { 112 sources = [ "avpickerparam.cpp" ] 113 114 stack_protector_ret = true 115 sanitize = { 116 cfi = true 117 cfi_cross_dso = true 118 debug = false 119 } 120 121 if (use_mingw_win || use_mac || use_linux) { 122 deps = [ ":gen_obj_src_avpickerparam_abc_preview" ] 123 } else { 124 deps = [ ":avpickerparam_abc" ] 125 } 126 defines = [] 127 if (use_mingw_win) { 128 defines += [ "WINDOWS_PLATFORM" ] 129 } else if (use_mac) { 130 defines += [ "MAC_PLATFORM" ] 131 } else if (use_linux) { 132 defines += [ "LINUX_PLATFORM" ] 133 } 134 135 external_deps = [ "napi:ace_napi" ] 136 137 relative_install_dir = "module/multimedia" 138 subsystem_name = "multimedia" 139 part_name = "av_session" 140} 141