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 ] 40 41 defines = [ "HAS_PIN_AUTH_PART" ] 42 43 if (build_selinux) { 44 external_deps += [ "selinux:libselinux" ] 45 defines += [ "SURPPORT_SELINUX" ] 46 } 47 48 subsystem_name = "developtools" 49 output_name = "sudo" 50 part_name = "hdc" 51 } 52} 53 54group("sudo") { 55 if (hdc_feature_support_sudo) { 56 deps = [ ":exec_sudo" ] 57 } 58} 59