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 "//third_party/json/single_include", 43 ] 44} 45 46if (is_android || is_ios) { 47 ohos_source_set("relational_common_base") { 48 sources = 49 [ "${relational_store_native_path}/appdatafwk/src/serializable.cpp" ] 50 51 if (is_mingw || is_mac || is_ios) { 52 sources += 53 [ "${relational_store_native_path}/appdatafwk/src/mingw_endian.cpp" ] 54 } else if (is_ohos || is_android) { 55 sources += [ 56 "${relational_store_native_path}/appdatafwk/src/general_endian.cpp", 57 ] 58 cflags_cc = [ "-fvisibility=hidden" ] 59 } 60 61 configs = [ 62 ":common_public_config", 63 ":appdatafwk_public_config", 64 ] 65 66 subsystem_name = "distributeddatamgr" 67 part_name = "relational_store" 68 69 public_configs = [ ":common_public_config" ] 70 } 71} else { 72 ohos_shared_library("relational_common_base") { 73 if (is_ohos) { 74 branch_protector_ret = "pac_ret" 75 sanitize = { 76 cfi = true 77 cfi_cross_dso = true 78 debug = false 79 } 80 } 81 82 sources = 83 [ "${relational_store_native_path}/appdatafwk/src/serializable.cpp" ] 84 85 if (is_mingw || is_mac || is_ios) { 86 sources += 87 [ "${relational_store_native_path}/appdatafwk/src/mingw_endian.cpp" ] 88 } else if (is_ohos || is_android) { 89 sources += [ 90 "${relational_store_native_path}/appdatafwk/src/general_endian.cpp", 91 ] 92 cflags_cc = [ "-fvisibility=hidden" ] 93 } 94 95 configs = [ 96 ":common_public_config", 97 ":appdatafwk_public_config", 98 ] 99 100 subsystem_name = "distributeddatamgr" 101 part_name = "relational_store" 102 103 public_configs = [ ":common_public_config" ] 104 } 105} 106 107ohos_shared_library("native_appdatafwk") { 108 branch_protector_ret = "pac_ret" 109 sanitize = { 110 cfi = true 111 cfi_cross_dso = true 112 debug = false 113 } 114 115 sources = 116 [ "${relational_store_native_path}/appdatafwk/src/shared_block.cpp" ] 117 118 configs = [ ":appdatafwk_config" ] 119 120 subsystem_name = "distributeddatamgr" 121 innerapi_tags = [ "platformsdk_indirect" ] 122 part_name = "relational_store" 123 124 external_deps = [ 125 "c_utils:utils", 126 "hilog:libhilog", 127 "ipc:ipc_single", 128 ] 129 130 public_configs = [ ":appdatafwk_public_config" ] 131} 132