• 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.
13import("//build/ohos.gni")
14
15# NOSORT
16import("../../../camera.gni")
17
18# NOSORT
19import("//build/config/components/hc_gen/hc_gen.gni")
20import("//build/config/components/hdi/hdi.gni")
21import("../camera_usb.gni")
22hc_gen_c("generate_source") {
23  sources = [
24    "./pipeline_core/config.hcs",
25    "./pipeline_core/params.hcs",
26  ]
27}
28
29action("copy_source") {
30  script = "/usr/bin/env"
31  outputs = [ "$target_out_dir/tmp.c" ]  # no use, just for gn complains
32  args = [
33    "cp",
34    "-f",
35  ]
36  args += rebase_path(get_target_outputs(":generate_source"))
37  args += [ rebase_path(
38          "$camera_path_usb/pipeline_core/pipeline_impl/src/strategy/config/") ]
39  deps = [ ":generate_source" ]
40}
41
42ohos_prebuilt_etc("config.c") {
43  deps = [ ":copy_source" ]
44  source = "$camera_path_usb/pipeline_core/pipeline_impl/src/strategy/config/config.c"
45  exec_script(
46      "/usr/bin/env",
47      [
48        "touch",
49        rebase_path(
50            "$camera_path_usb/pipeline_core/pipeline_impl/src/strategy/config/config.c"),
51      ])
52  subsystem_name = "hdf"
53  part_name = "drivers_peripheral_camera"
54}
55
56ohos_prebuilt_etc("params.c") {
57  deps = [ ":copy_source" ]
58  source = "$camera_path_usb/pipeline_core/pipeline_impl/src/strategy/config/params.c"
59  exec_script(
60      "/usr/bin/env",
61      [
62        "touch",
63        rebase_path(
64            "$camera_path_usb/pipeline_core/pipeline_impl/src/strategy/config/params.c"),
65      ])
66  subsystem_name = "hdf"
67  part_name = "drivers_peripheral_camera"
68}
69
70hc_gen("build_ipp_algo_config") {
71  sources = [ rebase_path("./pipeline_core/ipp_algo_config.hcs") ]
72}
73
74ohos_prebuilt_etc("ipp_algo_config.hcb") {
75  deps = [ ":build_ipp_algo_config" ]
76  hcs_outputs = get_target_outputs(":build_ipp_algo_config")
77  source = hcs_outputs[0]
78  relative_install_dir = "hdfconfig"
79  install_images = [ chipset_base_dir ]
80  subsystem_name = "hdf"
81  part_name = "drivers_peripheral_camera"
82}
83
84if (drivers_peripheral_camera_use_commom_usb_camera_host_config) {
85  hc_gen("build_usb_camera_host_config") {
86    sources = [ rebase_path("hdi_impl/usb_camera_host_config.hcs") ]
87    outputs = [ "$target_gen_dir/camera_host_config.hcb" ]
88  }
89  ohos_prebuilt_etc("camera_host_config.hcb") {
90    deps = [ ":build_usb_camera_host_config" ]
91    hcs_outputs = get_target_outputs(":build_usb_camera_host_config")
92    source = hcs_outputs[0]
93    relative_install_dir = "hdfconfig"
94    install_images = [ chipset_base_dir ]
95    subsystem_name = "hdf"
96    part_name = "drivers_peripheral_camera"
97  }
98}
99
100config("example_config") {
101  visibility = [ ":*" ]
102
103  cflags = [
104    "-Wno-error",
105    "-Wno-unused-function",
106    "-Wno-unused-parameter",
107  ]
108}
109
110group("chipset_build") {
111  public_deps = [
112    ":config.c",
113    ":ipp_algo_config.hcb",
114    ":params.c",
115    "$camera_path_usb/adapter/platform/v4l2/src/driver_adapter:usb_camera_v4l2_adapter",
116  ]
117
118  if (drivers_peripheral_camera_use_commom_usb_camera_host_config) {
119    public_deps += [ ":camera_host_config.hcb" ]
120  }
121}
122