1# Copyright (c) Huawei Technologies Co., Ltd. 2021-2022. All rights reserved. 2 3import("//drivers/hdf_core/framework/tools/hc-gen/hc_gen.gni") 4import("//drivers/peripheral/camera/camera.gni") 5 6if (defined(ohos_lite)) { 7 import("//build/lite/config/component/lite_component.gni") 8 import("//drivers/hdf_core/adapter/uhdf2/uhdf.gni") 9 10 hc_gen("build_config") { 11 hcs_file_prefix = "$product_config_path/hdf_config/uhdf/camera" 12 sources = [ 13 "$hcs_file_prefix/driver/mpp_config.hcs", 14 "$hcs_file_prefix/hdi_impl/camera_host_config.hcs", 15 "$hcs_file_prefix/pipeline_core/ipp_algo_config.hcs", 16 ] 17 outputs = [ "$root_out_dir/etc/camera/{{source_name_part}}.hcb" ] 18 } 19 20 group("hispark_taurus_build") { 21 exec_script( 22 "//build/lite/run_shell_cmd.py", 23 [ 24 "touch", 25 rebase_path( 26 "$camera_path/pipeline_core/pipeline_impl/src/strategy/config/config.c"), 27 rebase_path( 28 "$camera_path/pipeline_core/pipeline_impl/src/strategy/config/params.c"), 29 ]) 30 31 deps = [ 32 ":build_config", 33 "driver_adapter:driver_adapter", 34 ] 35 } 36} else { 37 import("//build/ohos.gni") 38 import("//drivers/hdf_core/adapter/uhdf2/uhdf.gni") 39 40 hc_gen("build_camera_host_config") { 41 sources = [ rebase_path( 42 "$product_config_path/hdf_config/uhdf/camera/hdi_impl/camera_host_config.hcs") ] 43 outputs = [ "$target_gen_dir/hdi_impl/{{source_name_part}}.hcb" ] 44 } 45 46 ohos_prebuilt_etc("camera_host_config.hcb") { 47 deps = [ ":build_camera_host_config" ] 48 hcs_outputs = get_target_outputs(":build_camera_host_config") 49 source = hcs_outputs[0] 50 relative_install_dir = "hdfconfig" 51 install_images = [ chipset_base_dir ] 52 subsystem_name = "hdf" 53 part_name = "drivers_peripheral_camera" 54 } 55 56 hc_gen_c("generate_source") { 57 sources = [ 58 "$product_config_path/hdf_config/uhdf/camera/pipeline_core/config.hcs", 59 "$product_config_path/hdf_config/uhdf/camera/pipeline_core/params.hcs", 60 ] 61 } 62 63 action("copy_source") { 64 script = "/usr/bin/env" 65 outputs = [ "$target_out_dir/tmp.c" ] # no use, just for gn complains 66 args = [ 67 "cp", 68 "-f", 69 ] 70 args += rebase_path(get_target_outputs(":generate_source")) 71 args += [ rebase_path( 72 "$camera_path/pipeline_core/pipeline_impl/src/strategy/config/") ] 73 deps = [ ":generate_source" ] 74 } 75 76 ohos_prebuilt_etc("config.c") { 77 deps = [ ":copy_source" ] 78 source = 79 "$camera_path/pipeline_core/pipeline_impl/src/strategy/config/config.c" 80 exec_script( 81 "/usr/bin/env", 82 [ 83 "touch", 84 rebase_path( 85 "$camera_path/pipeline_core/pipeline_impl/src/strategy/config/config.c"), 86 ]) 87 } 88 89 ohos_prebuilt_etc("params.c") { 90 deps = [ ":copy_source" ] 91 source = 92 "$camera_path/pipeline_core/pipeline_impl/src/strategy/config/params.c" 93 exec_script( 94 "/usr/bin/env", 95 [ 96 "touch", 97 rebase_path( 98 "$camera_path/pipeline_core/pipeline_impl/src/strategy/config/params.c"), 99 ]) 100 } 101 102 hc_gen("build_ipp_algo_config") { 103 sources = [ rebase_path( 104 "$product_config_path/hdf_config/uhdf/camera/pipeline_core/ipp_algo_config.hcs") ] 105 outputs = [ "$target_gen_dir/pipeline_core/{{source_name_part}}.hcb" ] 106 } 107 108 ohos_prebuilt_etc("ipp_algo_config.hcb") { 109 deps = [ ":build_ipp_algo_config" ] 110 hcs_outputs = get_target_outputs(":build_ipp_algo_config") 111 source = hcs_outputs[0] 112 relative_install_dir = "hdfconfig" 113 install_images = [ chipset_base_dir ] 114 subsystem_name = "hdf" 115 part_name = "drivers_peripheral_camera" 116 } 117 118 hc_gen("build_mpp_config_hcs") { 119 sources = [ rebase_path( 120 "$product_config_path/hdf_config/uhdf/camera/driver/mpp_config.hcs") ] 121 outputs = [ "$target_gen_dir/driver/{{source_name_part}}.hcb" ] 122 } 123 124 ohos_prebuilt_etc("mpp_config.hcb") { 125 deps = [ ":build_mpp_config_hcs" ] 126 hcs_outputs = get_target_outputs(":build_mpp_config_hcs") 127 source = hcs_outputs[0] 128 relative_install_dir = "hdfconfig" 129 install_images = [ chipset_base_dir ] 130 subsystem_name = "hdf" 131 part_name = "drivers_peripheral_camera" 132 } 133 134 group("hispark_taurus_build") { 135 public_deps = [ 136 ":camera_host_config.hcb", 137 ":config.c", 138 ":ipp_algo_config.hcb", 139 ":mpp_config.hcb", 140 ":params.c", 141 "driver_adapter:driver_adapter", 142 "pipeline_core:camera_ipp_algo_example", 143 ] 144 } 145} 146