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