1# 2# Copyright (c) 2020-2022 Huawei Device Co., Ltd. 3# Licensed under the Apache License, Version 2.0 (the "License"); 4# you may not use this file except in compliance with the License. 5# You may obtain a copy of the License at 6# 7# http://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12# See the License for the specific language governing permissions and 13# limitations under the License. 14# 15import("//build/ohos.gni") 16 17ohos_shared_library("cipher_shared") { 18 if (os_level == "standard") { 19 subsystem_name = "security" 20 part_name = "huks" 21 22 sanitize = { 23 cfi = true 24 cfi_cross_dso = true 25 debug = false 26 } 27 } 28 29 innerapi_tags = [ "platformsdk" ] 30 sources = [ 31 "src/cipher_aes.c", 32 "src/cipher_rsa.c", 33 ] 34 35 if (os_level == "small") { 36 sources += [ "src/cipher_log_lite.c" ] 37 } else if (os_level == "standard") { 38 sources += [ "src/cipher_log.c" ] 39 } 40 41 include_dirs = [ "include" ] 42 external_deps = [ 43 "bounds_checking_function:libsec_shared", 44 "mbedtls:mbedtls_shared", 45 ] 46 47 if (os_level == "small") { 48 external_deps += [ "hilog_lite:hilog_shared" ] 49 } else if (os_level == "standard") { 50 external_deps += [ "hilog:libhilog" ] 51 } 52 53 cflags = [ 54 "-Wall", 55 "-Werror", 56 "-Wno-format", 57 "-Wno-format-extra-args", 58 ] 59} 60