1# Copyright (C) 2022 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("../../screenlock.gni")
16
17config("screenlock_mgr_frameworks_native_config") {
18  visibility = [ ":*" ]
19  include_dirs = [
20    "include",
21    "${screenlock_mgr_path}/frameworks/native/include",
22    "${screenlock_mgr_path}/utils/include",
23    "${screenlock_mgr_path}/services/include",
24  ]
25
26  cflags_cc = []
27}
28
29ohos_shared_library("screenlock_client") {
30  if (is_standard_system) {
31    sanitize = {
32      cfi = true
33      cfi_cross_dso = true
34      debug = false
35      integer_overflow = true
36      boundary_sanitize = true
37      ubsan = true
38    }
39    branch_protector_ret = "pac_ret"
40    sources = [
41      "${screenlock_mgr_path}/frameworks/native/src/screenlock_app_manager.cpp",
42      "${screenlock_mgr_path}/frameworks/native/src/screenlock_callback_stub.cpp",
43      "${screenlock_mgr_path}/frameworks/native/src/screenlock_manager.cpp",
44      "${screenlock_mgr_path}/frameworks/native/src/screenlock_manager_proxy.cpp",
45      "${screenlock_mgr_path}/frameworks/native/src/screenlock_system_ability_stub.cpp",
46    ]
47
48    cflags = [
49      "-fdata-sections",
50      "-ffunction-sections",
51      "-fvisibility=hidden",
52      "-Os",
53    ]
54
55    version_script = "screenlock_client.versionscript"
56
57    public_configs = [ ":screenlock_mgr_frameworks_native_config" ]
58
59    include_dirs = [
60      "include",
61      "${screenlock_mgr_path}/frameworks/native/include",
62    ]
63
64    deps = [ "${screenlock_mgr_path}/utils:screenlock_utils" ]
65
66    external_deps = [
67      "c_utils:utils",
68      "hilog:libhilog",
69      "hitrace:hitrace_meter",
70      "ipc:ipc_single",
71      "samgr:samgr_proxy",
72    ]
73    subsystem_name = "theme"
74    innerapi_tags = [
75      "platformsdk",
76      "sasdk",
77    ]
78    part_name = "screenlock_mgr"
79  }
80}
81ohos_static_library("screenlock_client_static") {
82  if (is_standard_system) {
83    sanitize = {
84      cfi = true
85      cfi_cross_dso = true
86      debug = false
87      integer_overflow = true
88      boundary_sanitize = true
89      ubsan = true
90    }
91    branch_protector_ret = "pac_ret"
92    sources = [
93      "${screenlock_mgr_path}/frameworks/native/src/screenlock_app_manager.cpp",
94      "${screenlock_mgr_path}/frameworks/native/src/screenlock_callback_stub.cpp",
95      "${screenlock_mgr_path}/frameworks/native/src/screenlock_manager.cpp",
96      "${screenlock_mgr_path}/frameworks/native/src/screenlock_manager_proxy.cpp",
97      "${screenlock_mgr_path}/frameworks/native/src/screenlock_system_ability_stub.cpp",
98    ]
99
100    public_configs = [ ":screenlock_mgr_frameworks_native_config" ]
101
102    include_dirs = [
103      "include",
104      "${screenlock_mgr_path}/frameworks/native/include",
105    ]
106
107    deps = [ "${screenlock_mgr_path}/utils:screenlock_utils" ]
108
109    external_deps = [
110      "c_utils:utils",
111      "hilog:libhilog",
112      "hitrace:hitrace_meter",
113      "ipc:ipc_single",
114      "samgr:samgr_proxy",
115    ]
116    subsystem_name = "theme"
117    part_name = "screenlock_mgr"
118  }
119}
120