• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.
13import("//build/ohos.gni")
14
15ohos_shared_library("drm_service") {
16  stack_protector_ret = true
17  install_enable = true
18
19  include_dirs = [
20    "./server/include",
21    "./server/include/v1_0",
22    "./../../interfaces/inner_api/native",
23    "./../../interfaces/inner_api/native/drm",
24    "./../../interfaces/kits/c/drm_capi/common",
25    "./../utils",
26    "./../utils/include",
27  ]
28
29  sources = [
30    "./../utils/drm_dfx.cpp",
31    "./../utils/drm_dfx_utils.cpp",
32    "./../utils/drm_trace.cpp",
33    "./../utils/hdi_err_convertor.cpp",
34    "./../utils/drm_helper.cpp",
35    "./server/src/drm_host_manager.cpp",
36    "./server/src/key_session_service.cpp",
37    "./server/src/media_decrypt_module_service.cpp",
38    "./server/src/mediakeysystem_service.cpp",
39    "./server/src/mediakeysystemfactory_service.cpp",
40  ]
41  deps = [
42    ":drm_plugin_lazyloding",
43    "./idls:idl_sa_stub",
44  ]
45  external_deps = [
46    "ability_base:want",
47    "ability_base:zuri",
48    "ability_runtime:abilitykit_native",
49    "ability_runtime:napi_base_context",
50    "bundle_framework:appexecfwk_base",
51    "bundle_framework:appexecfwk_core",
52    "c_utils:utils",
53    "data_share:datashare_consumer",
54    "drivers_interface_drm:libdrm_proxy_1.0",
55    "hdf_core:libhdf_host",
56    "hdf_core:libhdf_ipc_adapter",
57    "hdf_core:libhdf_utils",
58    "hdf_core:libhdi",
59    "hicollie:libhicollie",
60    "hidumper:lib_dump_usage",
61    "hilog:libhilog",
62    "hisysevent:libhisysevent",
63    "hitrace:hitrace_meter",
64    "hitrace:libhitracechain",
65    "ipc:ipc_core",
66    "ipc:ipc_single",
67    "init:libbegetutil",
68    "memmgr:memmgrclient",
69    "napi:ace_napi",
70    "os_account:os_account_innerkits",
71    "safwk:system_ability_fwk",
72    "samgr:samgr_proxy",
73  ]
74
75  cflags = [
76    "-Wall",
77    "-fPIC",
78    "-fdata-sections",
79    "-ffunction-sections",
80    "-fno-asynchronous-unwind-tables",
81    "-fno-unwind-tables",
82    "-Os",
83  ]
84  if (target_cpu == "arm") {
85    cflags += [ "-DBINDER_IPC_32BIT" ]
86  }
87
88  sanitize = {
89    integer_overflow = true
90    ubsan = true
91    boundary_sanitize = true
92    cfi = true
93    cfi_cross_dso = true
94    cfi_vcall_icall_only = true
95    debug = false
96  }
97
98  if (use_musl) {
99    if (musl_use_jemalloc && musl_use_jemalloc_dfx_intf) {
100      cflags += [ "-DCONFIG_USE_JEMALLOC_DFX_INTF" ]
101    }
102  }
103
104  cflags_cc = cflags
105
106  subsystem_name = "multimedia"
107  part_name = "drm_framework"
108}
109
110ohos_prebuilt_etc("drm_plugin_lazyloding") {
111  source = "../etc/drm_plugin_lazyloding.cfg"
112  relative_install_dir = "drm"
113  part_name = "drm_framework"
114  subsystem_name = "multimedia"
115}
116