1# Copyright (c) 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. 13import("//build/ohos.gni") 14import("//foundation/filemanagement/storage_service/storage_service_aafwk.gni") 15 16## build sm execute bin file 17config("fscrypt_utils_config") { 18 visibility = [ ":*" ] 19 20 include_dirs = [ 21 "${storage_daemon_path}/include/libfscrypt", 22 "${storage_service_common_path}/include", 23 ] 24 25 cflags = [ 26 "-g3", 27 "-Wall", 28 "-O2", 29 ] 30} 31 32config("fscrypt_utils_public_config") { 33 visibility = [ ":*" ] 34 35 include_dirs = [ "${storage_daemon_path}/include/libfscrypt" ] 36 37 cflags = [ 38 "-g3", 39 "-Wall", 40 "-O2", 41 ] 42} 43 44ohos_static_library("libfscryptutils") { 45 branch_protector_ret = "pac_ret" 46 sanitize = { 47 integer_overflow = true 48 ubsan = true 49 boundary_sanitize = true 50 cfi = true 51 cfi_cross_dso = true 52 debug = false 53 } 54 55 output_name = "libfscryptutils" 56 sources = [ 57 "src/fscrypt_control.c", 58 "src/fscrypt_utils.c", 59 "src/init_utils.c", 60 "src/key_control.c", 61 "src/storage_radar_c.c", 62 "src/sysparam_dynamic.c", 63 ] 64 65 if (storage_service_user_crypto_manager) { 66 defines = [ "USER_CRYPTO_MANAGER" ] 67 } 68 69 configs = [ ":fscrypt_utils_config" ] 70 71 defines += [ 72 "STORAGE_LOG_TAG = \"StorageDaemon\"", 73 "LOG_DOMAIN = 0xD004301", 74 ] 75 76 external_deps = [ 77 "c_utils:utils", 78 "hilog:libhilog", 79 "hisysevent:libhisysevent", 80 "init:libbegetutil", 81 ] 82 83 subsystem_name = "filemanagement" 84 part_name = "storage_service" 85} 86 87ohos_static_library("libfscryptutils_static") { 88 branch_protector_ret = "pac_ret" 89 sanitize = { 90 integer_overflow = true 91 ubsan = true 92 boundary_sanitize = true 93 cfi = true 94 cfi_cross_dso = true 95 debug = false 96 } 97 98 output_name = "libfscryptutils_static" 99 sources = [ 100 "src/fscrypt_control.c", 101 "src/fscrypt_utils.c", 102 "src/key_control.c", 103 "src/storage_radar_c.c", 104 "src/sysparam_static.c", 105 ] 106 107 if (storage_service_user_crypto_manager) { 108 defines = [ "USER_CRYPTO_MANAGER" ] 109 } 110 111 configs = [ ":fscrypt_utils_config" ] 112 public_configs = [ ":fscrypt_utils_public_config" ] 113 114 defines += [ 115 "STORAGE_LOG_TAG = \"StorageDaemon\"", 116 "LOG_DOMAIN = 0xD004301", 117 ] 118 119 external_deps = [ 120 "bounds_checking_function:libsec_static", 121 "c_utils:utils", 122 "hilog:libhilog", 123 "hisysevent:libhisysevent", 124 "init:libbegetutil", 125 ] 126 127 subsystem_name = "filemanagement" 128 part_name = "storage_service" 129} 130