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/ohos.gni")
15import("//build/ohos/ace/ace.gni")
16
17js_declaration("drm_js") {
18  part_name = "drm_framework"
19  sources = [ "./@ohos.multimedia.drm.d.ts" ]
20}
21
22ohos_copy("drm_declaration") {
23  sources = [ "./@ohos.multimedia.drm.d.ts" ]
24  outputs = [ target_out_dir + "/$target_name/" ]
25  module_source_dir = target_out_dir + "/$target_name"
26  module_install_name = ""
27  part_name = "drm_framework"
28  subsystem_name = "multimedia"
29}
30
31ohos_shared_library("drm_napi") {
32  include_dirs = [
33    "./../../../../frameworks/js/drm_napi",
34    "./../../../../frameworks/native/drm",
35    "./../../../../frameworks/native/common",
36    "./../../../../interfaces/inner_api/native/drm",
37    "./../../../../interfaces/kits/js/drm_napi/include",
38    "./../../../../services/drm_service/",
39    "./../../../../services/drm_service/client/include",
40    "./../../../../services/drm_service/server/include",
41    "./../../../../services/drm_service/ipc",
42    "./../../../../services/utils/include",
43    "//foundation//arkui/napi/interfaces/kits",
44  ]
45  sources = [
46    "./../../../../frameworks/js/drm_napi/drm_enum_napi.cpp",
47    "./../../../../frameworks/js/drm_napi/drm_error_code.cpp",
48    "./../../../../frameworks/js/drm_napi/key_session_callback_napi.cpp",
49    "./../../../../frameworks/js/drm_napi/key_session_napi.cpp",
50    "./../../../../frameworks/js/drm_napi/media_key_system_callback_napi.cpp",
51    "./../../../../frameworks/js/drm_napi/media_key_system_napi.cpp",
52    "./../../../../frameworks/js/drm_napi/napi_async_work.cpp",
53    "./../../../../frameworks/js/drm_napi/napi_param_utils.cpp",
54    "./../../../../frameworks/js/drm_napi/native_module_ohos_drm.cpp",
55    "./../../../../services/utils/drm_api_operation.cpp",
56  ]
57  deps = [ "./../../../../frameworks/native:drm_framework" ]
58  external_deps = [
59    "ability_runtime:abilitykit_native",
60    "ability_runtime:napi_base_context",
61    "c_utils:utils",
62    "hiappevent:hiappevent_innerapi",
63    "hilog:libhilog",
64    "hisysevent:libhisysevent",
65    "hitrace:libhitracechain",
66    "ipc:ipc_core",
67    "napi:ace_napi",
68  ]
69  sanitize = {
70    cfi = true
71    cfi_cross_dso = true
72    cfi_vcall_icall_only = true
73    debug = false
74  }
75  cflags = [
76    "-fPIC",
77    "-fdata-sections",
78    "-ffunction-sections",
79    "-fno-asynchronous-unwind-tables",
80    "-fno-unwind-tables",
81    "-Os",
82  ]
83  cflags_cc = cflags
84  relative_install_dir = "module/multimedia"
85  part_name = "drm_framework"
86  subsystem_name = "multimedia"
87}
88