• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (C) 2024 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("//developtools/hdc/hdc.gni")
16
17ohos_executable("exec_sudo") {
18  if (hdc_feature_support_sudo) {
19    sources = [
20      "src/main.cpp",
21      "src/sudo_iam.cpp",
22    ]
23    sanitize = {
24      cfi = true
25      cfi_cross_dso = true
26      cfi_vcall_icall_only = true
27      debug = false
28    }
29
30    deps = []
31
32    external_deps = [
33      "c_utils:utils",
34      "ipc:ipc_single",
35      "os_account:account_iam_innerkits",
36      "os_account:os_account_innerkits",
37      "pin_auth:pinauth_framework",
38      "user_auth_framework:userauth_client",
39      "access_control_level_manager:aclmgr_sdk",
40    ]
41
42    defines = [ "HAS_PIN_AUTH_PART" ]
43
44    if (build_selinux) {
45      external_deps += [ "selinux:libselinux" ]
46      defines += [ "SURPPORT_SELINUX" ]
47    }
48
49    if (hdc_support_account_constraint) {
50      defines += [ "SURPPORT_ACCOUNT_CONSTRAINT" ]
51    }
52
53    subsystem_name = "developtools"
54    output_name = "sudo"
55    part_name = "hdc"
56  }
57}
58
59group("sudo") {
60  if (hdc_feature_support_sudo) {
61    deps = [ ":exec_sudo" ]
62  }
63}
64