• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
74##################################################################
75
76es2abc_gen_abc("gen_avpickerparam_abc") {
77  if (use_mingw_win || use_mac || use_linux) {
78    src_js = rebase_path("avpickerparam_mock.js")
79    dst_file = rebase_path(target_out_dir + "/avpickerparam.abc")
80    in_puts = [ "avpickerparam_mock.js" ]
81    out_puts = [ target_out_dir + "/avpickerparam.abc" ]
82    extra_args = [ "--module" ]
83  } else {
84    src_js = rebase_path("avpickerparam.js")
85    dst_file = rebase_path(target_out_dir + "/avpickerparam.abc")
86    in_puts = [ "avpickerparam.js" ]
87    out_puts = [ target_out_dir + "/avpickerparam.abc" ]
88    extra_args = [ "--module" ]
89  }
90}
91
92gen_js_obj("avpickerparam_abc") {
93  input = get_label_info(":gen_avpickerparam_abc", "target_out_dir") +
94          "/avpickerparam.abc"
95  output = target_out_dir + "/avpickerparam_abc.o"
96  dep = ":gen_avpickerparam_abc"
97}
98
99gen_obj("avpickerparam_abc_preview") {
100  input = get_label_info(":gen_avpickerparam_abc", "target_out_dir") +
101          "/avpickerparam.abc"
102  output = target_out_dir + "/avpickerparam_abc.c"
103  snapshot_dep = [ ":gen_avpickerparam_abc" ]
104}
105
106ohos_shared_library("avcastpickerparam") {
107  sources = [ "avpickerparam.cpp" ]
108
109  stack_protector_ret = true
110  sanitize = {
111    cfi = true
112    cfi_cross_dso = true
113    debug = false
114  }
115
116  if (use_mingw_win || use_mac || use_linux) {
117    deps = [ ":gen_obj_src_avpickerparam_abc_preview" ]
118  } else {
119    deps = [ ":avpickerparam_abc" ]
120  }
121  defines = []
122  if (use_mingw_win) {
123    defines += [ "WINDOWS_PLATFORM" ]
124  } else if (use_mac) {
125    defines += [ "MAC_PLATFORM" ]
126  } else if (use_linux) {
127    defines += [ "LINUX_PLATFORM" ]
128  }
129
130  external_deps = [ "napi:ace_napi" ]
131
132  relative_install_dir = "module/multimedia"
133  subsystem_name = "multimedia"
134  part_name = "av_session"
135}
136