# Copyright (c) 2023-2024 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") ohos_shared_library("drm_service") { stack_protector_ret = true install_enable = true include_dirs = [ "./client/include", "./server/include", "./server/include/v1_0", "./ipc", "./../../interfaces/inner_api/native", "./../../interfaces/inner_api/native/drm", "./../../interfaces/kits/c/drm_capi/common", "./../utils", "./../utils/include", "//foundation//arkui/napi/interfaces/kits", ] sources = [ "./../utils/drm_dfx.cpp", "./../utils/drm_dfx_utils.cpp", "./../utils/drm_trace.cpp", "./client/src/drm_listener_proxy.cpp", "./client/src/key_session_service_callback_proxy.cpp", "./client/src/mediakeysystem_service_callback_proxy.cpp", "./server/src/drm_host_manager.cpp", "./server/src/key_session_service.cpp", "./server/src/key_session_service_stub.cpp", "./server/src/media_decrypt_module_service.cpp", "./server/src/media_decrypt_module_service_stub.cpp", "./server/src/mediakeysystem_service.cpp", "./server/src/mediakeysystem_service_stub.cpp", "./server/src/mediakeysystemfactory_service.cpp", "./server/src/mediakeysystemfactory_service_stub.cpp", ] deps = [ ":drm_plugin_lazyloding" ] external_deps = [ "ability_base:want", "ability_runtime:abilitykit_native", "ability_runtime:napi_base_context", "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", "c_utils:utils", "drivers_interface_drm:libdrm_proxy_1.0", "hdf_core:libhdf_host", "hdf_core:libhdf_ipc_adapter", "hdf_core:libhdf_utils", "hdf_core:libhdi", "hicollie:libhicollie", "hidumper:lib_dump_usage", "hilog:libhilog", "hisysevent:libhisysevent", "hitrace:hitrace_meter", "hitrace:libhitracechain", "ipc:ipc_core", "ipc:ipc_single", "memmgr:memmgrclient", "napi:ace_napi", "netmanager_base:net_conn_manager_if", "safwk:system_ability_fwk", "samgr:samgr_proxy", ] public_external_deps = [ "json:nlohmann_json_static" ] cflags = [ "-Wall", "-fPIC", "-fdata-sections", "-ffunction-sections", "-fno-asynchronous-unwind-tables", "-fno-unwind-tables", "-Os", ] if (target_cpu == "arm") { cflags += [ "-DBINDER_IPC_32BIT" ] } sanitize = { integer_overflow = true ubsan = true boundary_sanitize = true cfi = true cfi_cross_dso = true cfi_vcall_icall_only = true debug = false } if (use_musl) { if (musl_use_jemalloc && musl_use_jemalloc_dfx_intf) { cflags += [ "-DCONFIG_USE_JEMALLOC_DFX_INTF" ] } } cflags_cc = cflags subsystem_name = "multimedia" part_name = "drm_framework" } ohos_prebuilt_etc("drm_plugin_lazyloding") { source = "../etc/drm_plugin_lazyloding.cfg" relative_install_dir = "drm" part_name = "drm_framework" subsystem_name = "multimedia" }