1# Copyright (c) 2022-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")
15
16declare_args() {
17  face_auth_enabled = true
18}
19
20config("faceauthservice_config") {
21  include_dirs = [
22    "inc",
23    "../common/inc",
24    "../common/logs",
25    "../common/utils",
26  ]
27}
28
29ohos_source_set("faceauthservice_source_set") {
30  sanitize = {
31    integer_overflow = true
32    ubsan = true
33    boundary_sanitize = true
34    cfi = true
35    cfi_cross_dso = true
36    debug = false
37    blocklist = "../cfi_blocklist.txt"
38  }
39  branch_protector_ret = "pac_ret"
40  sources = [
41    "src/face_auth_all_in_one_executor_hdi.cpp",
42    "src/face_auth_driver_hdi.cpp",
43    "src/face_auth_executor_callback_hdi.cpp",
44    "src/face_auth_interface_adapter.cpp",
45    "src/face_auth_service.cpp",
46    "src/sa_command_manager.cpp",
47    "src/screen_brightness_manager.cpp",
48    "src/service_ex_manager.cpp",
49  ]
50  include_dirs = [
51    "inc",
52    "../common/inc",
53    "../common/logs",
54    "../common/utils",
55  ]
56
57  public_configs = [ ":faceauthservice_config" ]
58
59  deps = [ "../frameworks/ipc:faceauth_framework_stub" ]
60
61  external_deps = [
62    "access_token:libaccesstoken_sdk",
63    "access_token:libtokenid_sdk",
64    "c_utils:utils",
65    "drivers_interface_camera:libbuffer_producer_sequenceable_1.0",
66    "drivers_interface_face_auth:libface_auth_proxy_2.0",
67    "hilog:libhilog",
68    "ipc:ipc_single",
69    "miscdevice:vibrator_interface_native",
70    "safwk:system_ability_fwk",
71    "samgr:samgr_proxy",
72    "user_auth_framework:userauth_executors",
73  ]
74
75  if (defined(global_parts_info.graphic_graphic_2d)) {
76    external_deps += [ "graphic_surface:surface" ]
77  }
78
79  remove_configs = [ "//build/config/compiler:no_exceptions" ]
80
81  subsystem_name = "useriam"
82  part_name = "face_auth"
83}
84
85ohos_shared_library("faceauthservice") {
86  sanitize = {
87    integer_overflow = true
88    ubsan = true
89    boundary_sanitize = true
90    cfi = true
91    cfi_cross_dso = true
92    debug = false
93    blocklist = "../cfi_blocklist.txt"
94  }
95  branch_protector_ret = "pac_ret"
96  deps = [ ":faceauthservice_source_set" ]
97
98  external_deps = [ "hilog:libhilog" ]
99
100  if (use_musl) {
101    version_script = "face_auth_service_map"
102  }
103
104  subsystem_name = "useriam"
105  part_name = "face_auth"
106}
107