1# Copyright (c) 2021-2025 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("../../os_account.gni") 16 17config("tools_acm_config") { 18 include_dirs = [ "include" ] 19 20 defines = [ 21 "ACCOUNT_LOG_TAG = \"AccountTool\"", 22 "LOG_DOMAIN = 0xD001B00", 23 ] 24 if (target_cpu == "arm64") { 25 defines += [ "_ARM64_" ] 26 } 27} 28 29ohos_source_set("tools_acm_source_set") { 30 branch_protector_ret = "pac_ret" 31 32 sanitize = { 33 cfi = true 34 cfi_cross_dso = true 35 debug = false 36 } 37 38 sources = [ 39 "${os_account_path}/frameworks/domain_account/src/domain_account_common.cpp", 40 "src/account_command.cpp", 41 "src/main.cpp", 42 ] 43 44 public_configs = [ ":tools_acm_config" ] 45 configs = [ "${domain_account_framework_path}:frameworks_domain_account_interface_public_config" ] 46 47 cflags = [] 48 if (target_cpu == "arm") { 49 cflags += [ "-DBINDER_IPC_32BIT" ] 50 } 51 if (os_account_multiple_active_accounts) { 52 cflags += [ "-DENABLE_MULTIPLE_ACTIVE_ACCOUNTS" ] 53 } 54 if (os_account_support_deactivate_main_os_account) { 55 cflags += [ "-DSUPPORT_STOP_MAIN_OS_ACCOUNT" ] 56 } 57 cflags += [ "-pipe" ] 58 cflags_cc = [ 59 "-Wdate-time", 60 "-Wformat=2", 61 "-Wfloat-equal", 62 "-Wshadow", 63 ] 64 65 deps = [ 66 "${common_path}:libaccount_common", 67 "${os_account_innerkits_native_path}:os_account_innerkits", 68 ] 69 70 external_deps = [ 71 "ability_base:base", 72 "ability_base:want", 73 "cJSON:cjson", 74 "c_utils:utils", 75 "hilog:libhilog", 76 ] 77 subsystem_name = "account" 78 part_name = "os_account" 79} 80 81ohos_executable("acm") { 82 branch_protector_ret = "pac_ret" 83 84 sanitize = { 85 cfi = true 86 cfi_cross_dso = true 87 debug = false 88 } 89 90 deps = [ ":tools_acm_source_set" ] 91 92 external_deps = [ "hilog:libhilog" ] 93 94 install_enable = true 95 96 subsystem_name = "account" 97 part_name = "os_account" 98} 99