1# Copyright (c) 2021 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/distributeddatamgr/relational_store/relational_store.gni") 15 16config("appdatafwk_config") { 17 visibility = [ ":*" ] 18 include_dirs = [ 19 "include", 20 "${relational_store_innerapi_path}/rdb/include", 21 "${relational_store_common_path}/include", 22 ] 23 if (!is_mingw && !is_mac) { 24 cflags_cc = [ "-fvisibility=hidden" ] 25 } 26} 27 28config("appdatafwk_public_config") { 29 visibility = [ ":*" ] 30 include_dirs = [ 31 "include", 32 "${relational_store_innerapi_path}/rdb/include", 33 "${relational_store_common_path}/include", 34 ] 35} 36 37config("common_public_config") { 38 visibility = [ ":*" ] 39 include_dirs = [ 40 "include", 41 "${relational_store_common_path}/include", 42 ] 43} 44 45if (is_android || is_ios) { 46 ohos_source_set("relational_common_base") { 47 sources = 48 [ "${relational_store_native_path}/appdatafwk/src/serializable.cpp" ] 49 50 if (is_mingw || is_mac || is_ios) { 51 sources += 52 [ "${relational_store_native_path}/appdatafwk/src/mingw_endian.cpp" ] 53 } else if (is_ohos || is_android) { 54 sources += [ 55 "${relational_store_native_path}/appdatafwk/src/general_endian.cpp", 56 ] 57 cflags_cc = [ "-fvisibility=hidden" ] 58 } 59 60 configs = [ 61 ":common_public_config", 62 ":appdatafwk_public_config", 63 ] 64 65 deps = [ 66 "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog_${target_os}", 67 "//third_party/json:nlohmann_json_static", 68 ] 69 70 subsystem_name = "distributeddatamgr" 71 part_name = "relational_store" 72 73 public_configs = [ ":common_public_config" ] 74 } 75} else { 76 ohos_shared_library("relational_common_base") { 77 if (is_ohos) { 78 branch_protector_ret = "pac_ret" 79 sanitize = { 80 boundary_sanitize = true 81 ubsan = true 82 cfi = true 83 cfi_cross_dso = true 84 debug = false 85 } 86 } 87 88 sources = 89 [ "${relational_store_native_path}/appdatafwk/src/serializable.cpp" ] 90 91 if (is_mingw || is_mac || is_ios) { 92 sources += 93 [ "${relational_store_native_path}/appdatafwk/src/mingw_endian.cpp" ] 94 } else if (is_ohos || is_android) { 95 sources += [ 96 "${relational_store_native_path}/appdatafwk/src/general_endian.cpp", 97 ] 98 cflags_cc = [ "-fvisibility=hidden" ] 99 } 100 101 configs = [ 102 ":common_public_config", 103 ":appdatafwk_public_config", 104 ] 105 external_deps = [ 106 "json:nlohmann_json_static", 107 "hilog:libhilog", 108 ] 109 110 subsystem_name = "distributeddatamgr" 111 part_name = "relational_store" 112 113 public_configs = [ ":common_public_config" ] 114 } 115} 116 117ohos_shared_library("native_appdatafwk") { 118 branch_protector_ret = "pac_ret" 119 sanitize = { 120 boundary_sanitize = true 121 ubsan = true 122 cfi = true 123 cfi_cross_dso = true 124 debug = false 125 } 126 127 sources = 128 [ "${relational_store_native_path}/appdatafwk/src/shared_block.cpp" ] 129 130 configs = [ ":appdatafwk_config" ] 131 132 subsystem_name = "distributeddatamgr" 133 innerapi_tags = [ "platformsdk_indirect" ] 134 part_name = "relational_store" 135 136 external_deps = [ 137 "c_utils:utils", 138 "json:nlohmann_json_static", 139 "hilog:libhilog", 140 "ipc:ipc_single", 141 ] 142 143 public_configs = [ ":appdatafwk_public_config" ] 144} 145