# Copyright (c) 2021 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("//drivers/hdf_core/adapter/uhdf2/uhdf.gni") import("$hdf_framework_path/tools/hc-gen/hc_gen.gni") hcs_source = "hdf.hcs" if (product_company == "openharmony") { hcs_file = "default/$hcs_source" } else { hcs_file = "//vendor/$product_company/$product_name/hdf_config/uhdf/$hcs_source" } hc_gen("build_hcs") { sources = [ rebase_path(hcs_file) ] outputs = [ "$target_gen_dir/hdf_default.hcb" ] } ohos_prebuilt_etc("hdf_default.hcb") { deps = [ ":build_hcs" ] hcs_outputs = get_target_outputs(":build_hcs") source = hcs_outputs[0] relative_install_dir = "hdfconfig" install_images = [ chipset_base_dir ] subsystem_name = "hdf" part_name = "hdf_core" } hc_gen_start_cfg("gen_start_cfg") { sources = [ rebase_path(hcs_file) ] outputs = [ "$target_gen_dir/hdf_devhost.cfg" ] } ohos_prebuilt_etc("hdf_devhost.cfg") { deps = [ ":gen_start_cfg" ] outputs = get_target_outputs(":gen_start_cfg") source = outputs[0] relative_install_dir = "init" install_images = [ chipset_base_dir ] subsystem_name = "hdf" part_name = "hdf_core" } group("hcs_entry") { deps = [] hcs_file_path = rebase_path("$hcs_file") if (exec_script( "//build/lite/run_shell_cmd.py", [ "if [ -f ${hcs_file_path} ]; then echo true; else echo false; fi" ], "value")) { deps += [ ":hdf_default.hcb", ":hdf_devhost.cfg", ] } }