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("//build/ohos/ace/ace.gni") 15import("//foundation/distributeddatamgr/preferences/preferences.gni") 16 17if (!is_mingw && !is_mac) { 18 ohos_copy("preferences_declaration") { 19 sources = [ "./api" ] 20 outputs = [ target_out_dir + "/$target_name/" ] 21 module_source_dir = target_out_dir + "/$target_name" 22 module_install_name = "" 23 subsystem_name = "distributeddatamgr" 24 part_name = "preferences" 25 } 26 27 ohos_shared_library("storage_napi") { 28 branch_protector_ret = "pac_ret" 29 sanitize = { 30 boundary_sanitize = true 31 ubsan = true 32 cfi = true 33 cfi_cross_dso = true 34 debug = false 35 } 36 cflags_cc = [ 37 "-std=c++17", 38 "-stdlib=libc++", 39 ] 40 include_dirs = [ 41 "include", 42 "${preferences_base_path}/frameworks/common/include", 43 ] 44 45 sources = [ 46 "src/entry_point_system_storage.cpp", 47 "src/napi_system_storage.cpp", 48 ] 49 50 deps = [ 51 "${preferences_base_path}/interfaces/inner_api:native_preferences", 52 "${preferences_napi_path}/common:preferences_jscommon", 53 ] 54 55 external_deps = [ 56 "ability_runtime:abilitykit_native", 57 "ability_runtime:extensionkit_native", 58 "ability_runtime:napi_base_context", 59 "common_event_service:cesfwk_innerkits", 60 "hilog:libhilog", 61 "napi:ace_napi", 62 ] 63 64 subsystem_name = "distributeddatamgr" 65 part_name = "preferences" 66 relative_install_dir = "module" 67 } 68} 69