1# Copyright (c) 2023-2024 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 14# for ohos_shared_library("drm_framework") 15 16import("//build/ohos.gni") 17import("//foundation/multimedia/drm_framework/config.gni") 18 19config("drm_framework_public_config") { 20 include_dirs = [ 21 "./../../interfaces/inner_api/native/drm", 22 "./../../services/drm_service", 23 ] 24} 25 26config("drm_framework_local_config") { 27 include_dirs = [ 28 "./../../interfaces/inner_api/native/drm", 29 "./../../services/drm_service/server/include", 30 "./../../services/include", 31 "./../../services/utils", 32 "./../../services/utils/include", 33 ] 34} 35 36ohos_shared_library("drm_framework") { 37 branch_protector_ret = "pac_ret" 38 install_enable = true 39 sources = [ 40 "./../../services/utils/drm_trace.cpp", 41 "./drm/key_session_impl.cpp", 42 "./drm/media_key_system_factory_impl.cpp", 43 "./drm/media_key_system_impl.cpp", 44 ] 45 46 cflags = [ 47 "-fPIC", 48 "-Wall", 49 "-fdata-sections", 50 "-ffunction-sections", 51 "-fno-asynchronous-unwind-tables", 52 "-fno-unwind-tables", 53 "-Os", 54 ] 55 56 if (target_cpu == "arm") { 57 cflags += [ "-DBINDER_IPC_32BIT" ] 58 } 59 sanitize = { 60 cfi = true 61 cfi_cross_dso = true 62 cfi_vcall_icall_only = true 63 debug = false 64 } 65 66 public_configs = [ 67 ":drm_framework_local_config", 68 ":drm_framework_public_config", 69 "./../../services/drm_service/idls:drm_sa_idl_config", 70 ] 71 72 include_dirs = [ "./drm" ] 73 74 deps = [ 75 ":drm_api_operation", 76 "./../../services/drm_service/idls:idl_sa_proxy", 77 ] 78 79 external_deps = [ 80 "ability_runtime:abilitykit_native", 81 "ability_runtime:napi_base_context", 82 "c_utils:utils", 83 "hilog:libhilog", 84 "hisysevent:libhisysevent", 85 "hitrace:hitrace_meter", 86 "hitrace:libhitracechain", 87 "ipc:ipc_core", 88 "napi:ace_napi", 89 "safwk:system_ability_fwk", 90 "samgr:samgr_proxy", 91 ] 92 93 cflags_cc = cflags 94 innerapi_tags = [ "platformsdk" ] 95 part_name = "drm_framework" 96 subsystem_name = "multimedia" 97} 98 99ohos_prebuilt_etc("drm_api_operation") { 100 source = "../../services/etc/drm_api_operation.cfg" 101 relative_install_dir = "drm" 102 part_name = "drm_framework" 103 subsystem_name = "multimedia" 104} 105