1# Copyright (c) 2021-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("../../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 46 cflags = [] 47 if (target_cpu == "arm") { 48 cflags += [ "-DBINDER_IPC_32BIT" ] 49 } 50 if (os_account_multiple_active_accounts) { 51 cflags += [ "-DENABLE_MULTIPLE_ACTIVE_ACCOUNTS" ] 52 } 53 if (os_account_support_deactivate_main_os_account) { 54 cflags += [ "-DSUPPORT_STOP_MAIN_OS_ACCOUNT" ] 55 } 56 cflags += [ "-pipe" ] 57 cflags_cc = [ 58 "-Wdate-time", 59 "-Wformat=2", 60 "-Wfloat-equal", 61 "-Wshadow", 62 ] 63 64 deps = [ 65 "${common_path}:libaccount_common", 66 "${os_account_core_path}:os_account_core", 67 ] 68 69 external_deps = [ 70 "ability_base:want", 71 "c_utils:utils", 72 "hilog:libhilog", 73 ] 74 subsystem_name = "account" 75 part_name = "os_account" 76} 77 78ohos_executable("acm") { 79 branch_protector_ret = "pac_ret" 80 81 sanitize = { 82 cfi = true 83 cfi_cross_dso = true 84 debug = false 85 } 86 87 deps = [ ":tools_acm_source_set" ] 88 89 external_deps = [ "hilog:libhilog" ] 90 91 install_enable = true 92 93 subsystem_name = "account" 94 part_name = "os_account" 95} 96