# Copyright (c) 2021-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("./../uhdf.gni") hdf_framework_path = "./../../../framework" hdf_interfaces_path = "./../../../interfaces" hdf_uhdf_path = "./.." config("libhdf_host_public_config") { visibility = [ ":*" ] include_dirs = [ "$hdf_interfaces_path/inner_api/core", "$hdf_interfaces_path/inner_api/osal/shared", "$hdf_interfaces_path/inner_api/host/shared", "$hdf_interfaces_path/inner_api/host/uhdf", ] } if (defined(ohos_lite)) { group("libhdf_host") { deps = [] } } else { ohos_shared_library("libhdf_host") { if (target_cpu == "arm64" || target_cpu == "x86_64") { defines = [ "__ARCH64__" ] } public_configs = [ ":libhdf_host_public_config" ] include_dirs = [ "$hdf_framework_path/core/manager/include", "$hdf_framework_path/core/host/include", "$hdf_framework_path/core/shared/include", "$hdf_framework_path/utils/include", "$hdf_uhdf_path/include/host", "$hdf_uhdf_path/shared/include", "$hdf_uhdf_path/manager/include", "$hdf_uhdf_path/security/include", "$hdf_uhdf_path/utils/include", "$hdf_uhdf_path/osal/include", "include", ] sources = [ "$hdf_framework_path/core/host/src/devhost_service.c", "$hdf_framework_path/core/host/src/devmgr_service_clnt.c", "$hdf_framework_path/core/host/src/devsvc_manager_clnt.c", "$hdf_framework_path/core/host/src/hdf_device.c", "$hdf_framework_path/core/host/src/hdf_device_node.c", "$hdf_framework_path/core/host/src/hdf_device_object.c", "$hdf_framework_path/core/host/src/hdf_device_token.c", "$hdf_framework_path/core/host/src/hdf_load_vdi.c", "$hdf_framework_path/core/host/src/hdf_observer_record.c", "$hdf_framework_path/core/host/src/hdf_power_manager.c", "$hdf_framework_path/core/host/src/hdf_service_observer.c", "$hdf_framework_path/core/host/src/hdf_service_subscriber.c", "$hdf_framework_path/core/host/src/power_state_token.c", "$hdf_framework_path/core/manager/src/hdf_host_info.c", "$hdf_framework_path/core/shared/src/hdf_device_info.c", "$hdf_framework_path/core/shared/src/hdf_object_manager.c", "$hdf_framework_path/core/shared/src/hdf_service_record.c", "$hdf_framework_path/utils/src/hdf_task_queue.c", "$hdf_uhdf_path/host/src/devhost_dump.c", "$hdf_uhdf_path/host/src/devhost_object_config.c", "$hdf_uhdf_path/host/src/devhost_service_full.c", "$hdf_uhdf_path/host/src/devhost_service_stub.c", "$hdf_uhdf_path/host/src/device_service_stub.c", "$hdf_uhdf_path/host/src/device_token_stub.c", "$hdf_uhdf_path/host/src/devmgr_service_proxy.c", "$hdf_uhdf_path/host/src/devsvc_manager_proxy.c", "$hdf_uhdf_path/host/src/driver_loader_full.c", "$hdf_uhdf_path/host/src/hdf_device_thread.c", "$hdf_uhdf_path/host/src/hdf_devsvc_manager_clnt.c", "$hdf_uhdf_path/host/src/hdf_pm_reg.c", "$hdf_uhdf_path/shared/src/dev_attribute_serialize.c", "$hdf_uhdf_path/shared/src/hcb_config_entry.c", ] if (is_standard_system) { deps = [ "../ipc:libhdf_ipc_adapter", "../utils:libhdf_utils", ] external_deps = [ "c_utils:utils", "hilog:libhilog", ] } else { external_deps = [ "hilog:libhilog" ] } install_images = [ chipset_base_dir ] subsystem_name = "hdf" part_name = "hdf_core" } ohos_executable("hdf_devhost") { include_dirs = [ "$hdf_framework_path/core/manager/include", "$hdf_framework_path/core/host/include", "$hdf_framework_path/core/shared/include", "$hdf_framework_path/utils/include", "$hdf_uhdf_path/include/host", "$hdf_uhdf_path/shared/include", "$hdf_uhdf_path/manager/include", "$hdf_uhdf_path/osal/include", "$hdf_interfaces_path/inner_api/core", "include", ] sources = [ "devhost.c" ] if (is_standard_system) { deps = [ "../host:libhdf_host", "../ipc:libhdf_ipc_adapter", "../utils:libhdf_utils", ] external_deps = [ "c_utils:utils", "hilog:libhilog", "init:libbegetutil", ] } else { external_deps = [ "hilog:libhilog" ] } # Ensure that the maximum page size is 4096 and the load section is aligned ldflags = [ "-Wl,-z,max-page-size=4096", "-Wl,-z,separate-code", ] install_enable = true install_images = [ chipset_base_dir ] subsystem_name = "hdf" part_name = "hdf_core" } }