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 ] 44 sources = [ 45 "./../../../../frameworks/js/drm_napi/drm_enum_napi.cpp", 46 "./../../../../frameworks/js/drm_napi/key_session_callback_napi.cpp", 47 "./../../../../frameworks/js/drm_napi/key_session_napi.cpp", 48 "./../../../../frameworks/js/drm_napi/media_key_system_callback_napi.cpp", 49 "./../../../../frameworks/js/drm_napi/media_key_system_napi.cpp", 50 "./../../../../frameworks/js/drm_napi/napi_async_work.cpp", 51 "./../../../../frameworks/js/drm_napi/napi_err_convertor.cpp", 52 "./../../../../frameworks/js/drm_napi/napi_param_utils.cpp", 53 "./../../../../frameworks/js/drm_napi/native_module_ohos_drm.cpp", 54 "./../../../../services/utils/drm_api_operation.cpp", 55 ] 56 deps = [ "./../../../../frameworks/native:drm_framework" ] 57 external_deps = [ 58 "ability_runtime:abilitykit_native", 59 "ability_runtime:napi_base_context", 60 "c_utils:utils", 61 "hiappevent:hiappevent_innerapi", 62 "hilog:libhilog", 63 "hisysevent:libhisysevent", 64 "hitrace:libhitracechain", 65 "ipc:ipc_core", 66 "napi:ace_napi", 67 ] 68 sanitize = { 69 cfi = true 70 cfi_cross_dso = true 71 cfi_vcall_icall_only = true 72 debug = false 73 } 74 cflags = [ 75 "-fPIC", 76 "-fdata-sections", 77 "-ffunction-sections", 78 "-fno-asynchronous-unwind-tables", 79 "-fno-unwind-tables", 80 "-Os", 81 ] 82 cflags_cc = cflags 83 relative_install_dir = "module/multimedia" 84 part_name = "drm_framework" 85 subsystem_name = "multimedia" 86} 87