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 sources = 74 [ "${relational_store_native_path}/appdatafwk/src/serializable.cpp" ] 75 76 if (is_mingw || is_mac || is_ios) { 77 sources += 78 [ "${relational_store_native_path}/appdatafwk/src/mingw_endian.cpp" ] 79 } else if (is_ohos || is_android) { 80 sources += [ 81 "${relational_store_native_path}/appdatafwk/src/general_endian.cpp", 82 ] 83 cflags_cc = [ "-fvisibility=hidden" ] 84 } 85 86 configs = [ 87 ":common_public_config", 88 ":appdatafwk_public_config", 89 ] 90 91 subsystem_name = "distributeddatamgr" 92 part_name = "relational_store" 93 94 public_configs = [ ":common_public_config" ] 95 } 96} 97 98ohos_shared_library("native_appdatafwk") { 99 sources = 100 [ "${relational_store_native_path}/appdatafwk/src/shared_block.cpp" ] 101 102 configs = [ ":appdatafwk_config" ] 103 104 subsystem_name = "distributeddatamgr" 105 innerapi_tags = [ "platformsdk_indirect" ] 106 part_name = "relational_store" 107 108 external_deps = [ 109 "c_utils:utils", 110 "hilog:libhilog", 111 "ipc:ipc_single", 112 ] 113 114 public_configs = [ ":appdatafwk_public_config" ] 115} 116