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_js_napi_config") {
18  visibility = [ ":*" ]
19  include_dirs = [ "include" ]
20
21  cflags_cc = []
22}
23
24ohos_shared_library("screenlock") {
25  if (is_standard_system) {
26    sanitize = {
27      cfi = true
28      cfi_cross_dso = true
29      debug = false
30      integer_overflow = true
31      boundary_sanitize = true
32      ubsan = true
33    }
34    branch_protector_ret = "pac_ret"
35    include_dirs = [
36      "${screenlock_mgr_path}/services/include",
37      "${screenlock_mgr_path}/utils/include",
38    ]
39
40    public_configs = [ ":screenlock_mgr_frameworks_js_napi_config" ]
41
42    sources = [
43      "src/async_call.cpp",
44      "src/napi_screenlock_ability.cpp",
45      "src/screenlock_callback.cpp",
46      "src/screenlock_js_util.cpp",
47      "src/screenlock_system_ability_callback.cpp",
48      "src/uv_queue.cpp",
49    ]
50
51    deps = [
52      "${screenlock_mgr_path}/interfaces/inner_api:screenlock_client_static",
53    ]
54
55    external_deps = [
56      "c_utils:utils",
57      "eventhandler:libeventhandler",
58      "hilog:libhilog",
59      "hitrace:hitrace_meter",
60      "ipc:ipc_single",
61      "napi:ace_napi",
62    ]
63
64    relative_install_dir = "module"
65    subsystem_name = "theme"
66    part_name = "screenlock_mgr"
67  }
68}
69
70ohos_static_library("screenlock_static") {
71  if (is_standard_system) {
72    sanitize = {
73      cfi = true
74      cfi_cross_dso = true
75      debug = false
76      integer_overflow = true
77      boundary_sanitize = true
78      ubsan = true
79    }
80    branch_protector_ret = "pac_ret"
81    testonly = true
82    include_dirs = [
83      "${screenlock_mgr_path}/services/include",
84      "${screenlock_mgr_path}/utils/include",
85    ]
86
87    public_configs = [ ":screenlock_mgr_frameworks_js_napi_config" ]
88
89    sources = [
90      "src/async_call.cpp",
91      "src/napi_screenlock_ability.cpp",
92      "src/screenlock_callback.cpp",
93      "src/screenlock_js_util.cpp",
94      "src/screenlock_system_ability_callback.cpp",
95      "src/uv_queue.cpp",
96    ]
97
98    deps = [
99      "${screenlock_mgr_path}/interfaces/inner_api:screenlock_client_static",
100    ]
101
102    external_deps = [
103      "c_utils:utils",
104      "eventhandler:libeventhandler",
105      "hilog:libhilog",
106      "hitrace:hitrace_meter",
107      "ipc:ipc_single",
108      "napi:ace_napi",
109    ]
110
111    subsystem_name = "theme"
112    part_name = "screenlock_mgr"
113  }
114}
115