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("//arkcompiler/ets_frontend/es2panda/es2abc_config.gni") 15import("//build/ohos.gni") 16import("//foundation/arkui/ace_engine/adapter/preview/build/config.gni") 17import("//foundation/arkui/ace_engine/build/ace_gen_obj.gni") 18import("//foundation/multimedia/av_session/config.gni") 19 20es2abc_gen_abc("gen_avpicker_abc") { 21 if (use_mingw_win || use_mac || use_linux) { 22 src_js = rebase_path("avpicker_mock.js") 23 dst_file = rebase_path(target_out_dir + "/avpicker.abc") 24 in_puts = [ "avpicker_mock.js" ] 25 out_puts = [ target_out_dir + "/avpicker.abc" ] 26 extra_args = [ "--module" ] 27 } else { 28 src_js = rebase_path("avpicker.js") 29 dst_file = rebase_path(target_out_dir + "/avpicker.abc") 30 in_puts = [ "avpicker.js" ] 31 out_puts = [ target_out_dir + "/avpicker.abc" ] 32 extra_args = [ "--module" ] 33 } 34} 35 36gen_js_obj("avpicker_abc") { 37 input = 38 get_label_info(":gen_avpicker_abc", "target_out_dir") + "/avpicker.abc" 39 output = target_out_dir + "/avpicker_abc.o" 40 dep = ":gen_avpicker_abc" 41} 42 43gen_obj("avpicker_abc_preview") { 44 input = 45 get_label_info(":gen_avpicker_abc", "target_out_dir") + "/avpicker.abc" 46 output = target_out_dir + "/avpicker_abc.c" 47 snapshot_dep = [ ":gen_avpicker_abc" ] 48} 49 50ohos_shared_library("avcastpicker") { 51 sources = [ "avpicker.cpp" ] 52 53 if (use_mingw_win || use_mac || use_linux) { 54 deps = [ ":gen_obj_src_avpicker_abc_preview" ] 55 } else { 56 deps = [ ":avpicker_abc" ] 57 } 58 defines = [] 59 if (use_mingw_win) { 60 defines += [ "WINDOWS_PLATFORM" ] 61 } else if (use_mac) { 62 defines += [ "MAC_PLATFORM" ] 63 } else if (use_linux) { 64 defines += [ "LINUX_PLATFORM" ] 65 } 66 67 external_deps = [ "napi:ace_napi" ] 68 69 relative_install_dir = "module/multimedia" 70 subsystem_name = "multimedia" 71 part_name = "av_session" 72} 73