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")
15config("drm_capi_common_config") {
16  include_dirs = [
17    "./common",
18    "./include",
19    "./../../../../interfaces/inner_api/native/drm",
20    "./../../../../services/utils/include",
21  ]
22  cflags = [
23    "-fno-exceptions",
24    "-Wall",
25    "-fno-common",
26    "-fstack-protector-all",
27    "-Wshadow",
28    "-FPIC",
29    "-FS",
30    "-D_FORTIFY_SOURCE=2",
31    "-Wformat=2",
32    "-Wdate-time",
33    "-fdata-sections",
34    "-ffunction-sections",
35    "-fno-asynchronous-unwind-tables",
36    "-fno-unwind-tables",
37    "-Os",
38  ]
39
40  cflags_cc = [
41    "-std=c++17",
42    "-fno-rtti",
43  ]
44}
45
46config("drm_capi_common_public_config") {
47  include_dirs = [
48    "./common",
49    "./include",
50    "./../../../../interfaces/inner_api/native/drm",
51    "./../../../../services/utils/include",
52  ]
53}
54
55ohos_shared_library("native_drm") {
56  install_enable = true
57
58  public_configs = [ ":drm_capi_common_public_config" ]
59  configs = [ ":drm_capi_common_config" ]
60
61  sanitize = {
62    cfi = true
63    cfi_cross_dso = true
64    cfi_vcall_icall_only = true
65    debug = false
66  }
67
68  sources = [
69    "./../../../../frameworks/c/drm_capi/native_mediakeysession.cpp",
70    "./../../../../frameworks/c/drm_capi/native_mediakeysystem.cpp",
71    "./../../../../services/utils/drm_api_operation.cpp",
72  ]
73
74  deps = [ "./../../../../frameworks/native:drm_framework" ]
75
76  external_deps = [
77    "c_utils:utils",
78    "hiappevent:hiappevent_innerapi",
79    "hilog:libhilog",
80    "hitrace:libhitracechain",
81    "ipc:ipc_core",
82  ]
83  innerapi_tags = [ "ndk" ]
84  output_extension = "so"
85  subsystem_name = "multimedia"
86  part_name = "drm_framework"
87}
88