• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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("//build/config/components/ace_engine/ace_gen_obj.gni")
17import("//foundation/multimedia/av_session/config.gni")
18
19es2abc_gen_abc("gen_avvolumepanel_abc") {
20  if ("${target_platform}" == "watch") {
21    src_js = rebase_path("avvolumepanel_watch.js")
22    dst_file = rebase_path(target_out_dir + "/avvolumepanel.abc")
23    in_puts = [ "avvolumepanel_watch.js" ]
24    out_puts = [ target_out_dir + "/avvolumepanel.abc" ]
25    extra_args = [ "--module" ]
26  } else {
27    src_js = rebase_path("avvolumepanel.js")
28    dst_file = rebase_path(target_out_dir + "/avvolumepanel.abc")
29    in_puts = [ "avvolumepanel.js" ]
30    out_puts = [ target_out_dir + "/avvolumepanel.abc" ]
31    extra_args = [ "--module" ]
32  }
33}
34
35gen_js_obj("avvolumepanel_abc") {
36  input = get_label_info(":gen_avvolumepanel_abc", "target_out_dir") +
37          "/avvolumepanel.abc"
38  output = target_out_dir + "/avvolumepanel_abc.o"
39  dep = ":gen_avvolumepanel_abc"
40}
41
42gen_obj("avvolumepanel_abc_preview") {
43  input =
44      get_label_info(":gen_avvolumepanel_abc", "target_out_dir") + "/avvolumepanel.abc"
45  output =  target_out_dir + "/avvolumepanel_abc.c"
46  snapshot_dep = [ ":gen_avvolumepanel_abc"]
47}
48
49ohos_shared_library("avvolumepanel") {
50  sources = [ "avvolumepanel.cpp" ]
51
52  if (use_mingw_win || use_mac || use_linux) {
53    deps = [ ":gen_obj_src_avvolumepanel_abc_preview" ]
54  } else {
55    deps = [ ":avvolumepanel_abc" ]
56  }
57  defines = []
58  if (use_mingw_win) {
59    defines += [ "WINDOWS_PLATFORM" ]
60  } else if (use_mac) {
61    defines += [ "MAC_PLATFORM" ]
62  } else if (use_linux) {
63    defines += [ "LINUX_PLATFORM" ]
64  }
65
66  sanitize = {
67    cfi = true
68    cfi_cross_dso = true
69    debug = false
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