1# Copyright (c) 2023 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 14import("//build/config/components/idl_tool/idl.gni") 15 16idl_gen_interface("drm_service_idl_interface") { 17 sources = [ 18 "IDrmListener.idl", 19 "IMediaDecryptModuleService.idl", 20 "IMediaKeySessionService.idl", 21 "IMediaKeySystemFactoryService.idl", 22 "IMediaKeySystemService.idl", 23 ] 24 sources_callback = [ 25 "IMediaKeySessionServiceCallback.idl", 26 "IMediaKeySystemServiceCallback.idl", 27 ] 28 sources_common = [ "DrmTypes.idl" ] 29 30 #client_enable = true 31 32 hitrace = "HITRACE_TAG_ABILITY_MANAGER" 33 34 log_domainid = "0xD002B21" 35 log_tag = "drm_service" 36 37 subsystem_name = "multimedia" 38 part_name = "drm_framework" 39} 40 41config("drm_sa_idl_config") { 42 include_dirs = [ 43 "src", 44 "${target_gen_dir}", 45 ] 46} 47 48ohos_source_set("idl_sa_proxy") { 49 output_values = get_target_outputs(":drm_service_idl_interface") 50 sources = filter_include(output_values, 51 [ 52 "*_service_proxy.cpp", 53 "*_listener_stub.cpp", 54 "*_types.cpp", 55 "*_callback_stub.cpp", 56 ]) 57 58 public_configs = [ ":drm_sa_idl_config" ] 59 60 deps = [ ":drm_service_idl_interface" ] 61 62 cflags = [ 63 "-Wall", 64 "-fPIC", 65 "-fdata-sections", 66 "-ffunction-sections", 67 "-fno-asynchronous-unwind-tables", 68 "-fno-unwind-tables", 69 "-Os", 70 ] 71 if (target_cpu == "arm") { 72 cflags += [ "-DBINDER_IPC_32BIT" ] 73 } 74 75 sanitize = { 76 integer_overflow = true 77 ubsan = true 78 boundary_sanitize = true 79 cfi = true 80 cfi_cross_dso = true 81 cfi_vcall_icall_only = true 82 debug = false 83 } 84 85 external_deps = [ 86 "c_utils:utils", 87 "hilog:libhilog", 88 "hitrace:hitrace_meter", 89 "ipc:ipc_single", 90 ] 91 92 part_name = "drm_framework" 93 subsystem_name = "multimedia" 94} 95 96ohos_source_set("idl_sa_stub") { 97 output_values = get_target_outputs(":drm_service_idl_interface") 98 sources = filter_include(output_values, 99 [ 100 "*_service_stub.cpp", 101 "*_listener_proxy.cpp", 102 "*_types.cpp", 103 "*_callback_proxy.cpp", 104 ]) 105 106 public_configs = [ ":drm_sa_idl_config" ] 107 108 deps = [ ":drm_service_idl_interface" ] 109 110 cflags = [ 111 "-Wall", 112 "-fPIC", 113 "-fdata-sections", 114 "-ffunction-sections", 115 "-fno-asynchronous-unwind-tables", 116 "-fno-unwind-tables", 117 "-Os", 118 ] 119 if (target_cpu == "arm") { 120 cflags += [ "-DBINDER_IPC_32BIT" ] 121 } 122 123 sanitize = { 124 integer_overflow = true 125 ubsan = true 126 boundary_sanitize = true 127 cfi = true 128 cfi_cross_dso = true 129 cfi_vcall_icall_only = true 130 debug = false 131 } 132 133 external_deps = [ 134 "c_utils:utils", 135 "hilog:libhilog", 136 "hitrace:hitrace_meter", 137 "ipc:ipc_single", 138 ] 139 140 part_name = "drm_framework" 141 subsystem_name = "multimedia" 142} 143