# Copyright (c) 2023 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//build/ohos.gni") import("./../../../framework/tools/hc-gen/hc_gen.gni") template("hdf_hcb") { assert(defined(invoker.source), "the source must to be set") assert(defined(invoker.part_name), "the part_name must to be set") hc_gen("build_hcs") { sources = [ rebase_path(invoker.source) ] outputs = [ "$target_gen_dir/hdf_default.hcb" ] } ohos_prebuilt_etc("$target_name") { deps = [ ":build_hcs" ] hcs_outputs = get_target_outputs(":build_hcs") source = hcs_outputs[0] relative_install_dir = "hdfconfig" install_images = [ chipset_base_dir ] if (defined(invoker.subsystem_name)) { subsystem_name = invoker.subsystem_name } part_name = invoker.part_name } } template("hdf_cfg") { assert(defined(invoker.source), "the source must to be set") assert(defined(invoker.part_name), "the part_name must to be set") hc_gen_start_cfg("gen_start_cfg") { sources = [ rebase_path(invoker.source) ] outputs = [ "$target_gen_dir/hdf_devhost.cfg" ] } ohos_prebuilt_etc("$target_name") { deps = [ ":gen_start_cfg" ] outputs = get_target_outputs(":gen_start_cfg") source = outputs[0] relative_install_dir = "init" install_images = [ chipset_base_dir ] if (defined(invoker.subsystem_name)) { subsystem_name = invoker.subsystem_name } part_name = invoker.part_name } }