1# Copyright (c) 2025 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. 13 14if (defined(ohos_lite)) { 15 import("//build/lite/config/component/lite_component.gni") 16} else { 17 import("//build/ohos.gni") 18} 19import("//foundation/distributedhardware/device_manager/device_manager.gni") 20 21if (defined(ohos_lite)) { 22 if (ohos_kernel_type == "liteos_m") { 23 static_library("devicemanagerminisdk") { 24 include_dirs = [] 25 26 sources = [] 27 28 deps = [] 29 30 cflags = [ 31 "-Wall", 32 "-O2", 33 "-std=c99", 34 "-Wdate-time", 35 "-Wextra", 36 "-Wfloat-equal", 37 ] 38 cflags_cc = cflags 39 } 40 } else { 41 shared_library("devicemanagerminisdk") { 42 include_dirs = [] 43 44 sources = [] 45 46 defines = [ 47 "LITE_DEVICE", 48 "HI_LOG_ENABLE", 49 "DH_LOG_TAG=\"devicemanagerkit\"", 50 "LOG_DOMAIN=0xD004111", 51 ] 52 53 deps = [] 54 } 55 } 56} else { 57 config("devicemanagerminisdk_config") { 58 include_dirs = [ 59 "include", 60 "include/ipc", 61 "${common_path}/include", 62 "${common_path}/include/ipc", 63 "${common_path}/include/ipc/model", 64 "${common_path}/include/ipc/standard", 65 "${devicemanager_path}/interfaces/inner_kits/native_cpp/include", 66 "${devicemanager_path}/interfaces/inner_kits/native_cpp/include/ipc", 67 "${devicemanager_path}/interfaces/inner_kits/native_cpp/include/ipc/standard", 68 ] 69 } 70 71 ohos_shared_library("devicemanagerminisdk") { 72 branch_protector_ret = "pac_ret" 73 74 sanitize = { 75 boundary_sanitize = true 76 cfi = true 77 cfi_cross_dso = true 78 debug = false 79 integer_overflow = true 80 ubsan = true 81 } 82 83 cflags = [ 84 "-Werror", 85 "-fPIC", 86 "-fstack-protector-strong", 87 ] 88 89 ldflags = [ 90 "-Wl,-z,relro", 91 "-Wl,-z,now", 92 ] 93 94 cflags_cc = cflags 95 96 sources = [ 97 "${common_path}/src/dm_constants.cpp", 98 "${common_path}/src/ipc/standard/ipc_cmd_register.cpp", 99 "${devicemanager_path}/interfaces/inner_kits/native_cpp/src/ipc/ipc_client_proxy.cpp", 100 "${devicemanager_path}/interfaces/inner_kits/native_cpp/src/ipc/standard/dm_service_load.cpp", 101 "${devicemanager_path}/interfaces/inner_kits/native_cpp/src/ipc/standard/ipc_client_server_proxy.cpp", 102 "src/device_manager_impl_mini.cpp", 103 "src/device_manager_mini.cpp", 104 "src/ipc/ipc_client_manager_mini.cpp", 105 "src/ipc/ipc_cmd_parser.cpp", 106 ] 107 108 public_configs = [ ":devicemanagerminisdk_config" ] 109 110 innerapi_tags = [ "platformsdk" ] 111 112 defines = [ 113 "HI_LOG_ENABLE", 114 "DH_LOG_TAG=\"devicemanagerminikit\"", 115 "LOG_DOMAIN=0xD004111", 116 ] 117 118 external_deps = [ 119 "c_utils:utils", 120 "hilog:libhilog", 121 "ipc:ipc_core", 122 "samgr:samgr_proxy", 123 ] 124 125 subsystem_name = "distributedhardware" 126 127 part_name = "device_manager" 128 } 129} 130