• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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  configs = [ "./../../../../services/drm_service/idls:drm_sa_idl_config" ]
33  include_dirs = [
34    "./../../../../frameworks/js/drm_napi",
35    "./../../../../frameworks/native/drm",
36    "./../../../../frameworks/native/common",
37    "./../../../../interfaces/inner_api/native/drm",
38    "./../../../../interfaces/kits/js/drm_napi/include",
39    "./../../../../services/drm_service/",
40    "./../../../../services/drm_service/server/include",
41    "./../../../../services/utils/include",
42  ]
43  sources = [
44    "./../../../../frameworks/js/drm_napi/drm_enum_napi.cpp",
45    "./../../../../frameworks/js/drm_napi/key_session_callback_napi.cpp",
46    "./../../../../frameworks/js/drm_napi/key_session_napi.cpp",
47    "./../../../../frameworks/js/drm_napi/media_key_system_callback_napi.cpp",
48    "./../../../../frameworks/js/drm_napi/media_key_system_napi.cpp",
49    "./../../../../frameworks/js/drm_napi/napi_async_work.cpp",
50    "./../../../../frameworks/js/drm_napi/napi_err_convertor.cpp",
51    "./../../../../frameworks/js/drm_napi/napi_param_utils.cpp",
52    "./../../../../frameworks/js/drm_napi/native_module_ohos_drm.cpp",
53    "./../../../../services/utils/drm_api_operation.cpp",
54  ]
55  deps = [ "./../../../../frameworks/native:drm_framework" ]
56  external_deps = [
57    "ability_runtime:abilitykit_native",
58    "ability_runtime:napi_base_context",
59    "c_utils:utils",
60    "hiappevent:hiappevent_innerapi",
61    "hilog:libhilog",
62    "hisysevent:libhisysevent",
63    "hitrace:libhitracechain",
64    "ipc:ipc_core",
65    "napi:ace_napi",
66  ]
67  sanitize = {
68    cfi = true
69    cfi_cross_dso = true
70    cfi_vcall_icall_only = true
71    debug = false
72  }
73  cflags = [
74    "-fPIC",
75    "-fdata-sections",
76    "-ffunction-sections",
77    "-fno-asynchronous-unwind-tables",
78    "-fno-unwind-tables",
79    "-Os",
80  ]
81  cflags_cc = cflags
82  relative_install_dir = "module/multimedia"
83  part_name = "drm_framework"
84  subsystem_name = "multimedia"
85}
86