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