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("distributeddb.gni") 15 16config("distrdb_config") { 17 visibility = [ ":*" ] 18 include_dirs = [ 19 "include", 20 "interfaces/include", 21 "interfaces/include/cloud", 22 "interfaces/src", 23 "interfaces/src/relational", 24 "common/include", 25 "common/include/cloud", 26 "common/include/relational", 27 "common/src/cloud", 28 "communicator/include", 29 "storage/include", 30 "storage/src", 31 "storage/src/multiver", 32 "storage/src/operation", 33 "storage/src/gaussdb_rd", 34 "storage/src/sqlite", 35 "storage/src/sqlite/kv", 36 "storage/src/sqlite/relational", 37 "storage/src/upgrader", 38 "storage/src/cloud", 39 "storage/src/kv", 40 "storage/src/relational", 41 "syncer/include", 42 "syncer/src", 43 "syncer/src/cloud", 44 "syncer/src/device", 45 "syncer/src/device/multiver", 46 "syncer/src/device/singlever", 47 "//third_party/openssl/include/", 48 ] 49 50 defines = [ 51 "_LARGEFILE64_SOURCE", 52 "_FILE_OFFSET_BITS=64", 53 "SQLITE_HAS_CODEC", 54 "SQLITE_ENABLE_JSON1", 55 "USING_HILOG_LOGGER", 56 "USE_SQLITE_SYMBOLS", 57 "USING_DB_JSON_EXTRACT_AUTOMATICALLY", 58 "JSONCPP_USE_BUILDER", 59 "OMIT_FLATBUFFER", 60 "OMIT_MULTI_VER", 61 "RELATIONAL_STORE", 62 "SQLITE_DISTRIBUTE_RELATIONAL", 63 "USE_DFX_ABILITY", 64 "SQLITE_ENABLE_DROPTABLE_CALLBACK", 65 "OPENSSL_SUPPRESS_DEPRECATED", 66 "MAX_UPLOAD_COUNT=30", 67 ] 68 if (is_debug) { 69 defines += [ "TRACE_SQLITE_EXECUTE" ] 70 } 71 if (is_ohos) { 72 defines += [ "USE_FFRT" ] 73 } 74} 75 76config("distrdb_public_config") { 77 visibility = [ "*:*" ] 78 include_dirs = [ 79 "interfaces/include", 80 "interfaces/include/relational", 81 "include", 82 "gaussdb_rd/include", 83 "gaussdb_rd/include/grd_base", 84 "gaussdb_rd/include/grd_document", 85 "gaussdb_rd/include/grd_kv", 86 ] 87} 88 89group("build_module") { 90 deps = [ ":distributeddb" ] 91} 92 93ohos_shared_library("distributeddb") { 94 branch_protector_ret = "pac_ret" 95 sanitize = { 96 cfi = true 97 cfi_cross_dso = true 98 debug = false 99 blocklist = "./cfi_blocklist.txt" 100 } 101 sources = distributeddb_src 102 103 configs = [ ":distrdb_config" ] 104 public_configs = [ ":distrdb_public_config" ] 105 106 deps = [ 107 "//third_party/sqlite:sqlite", 108 "//third_party/zlib:shared_libz", 109 ] 110 111 configs += [ "//third_party/jsoncpp:jsoncpp_config" ] 112 cflags_cc = [ "-fvisibility=hidden" ] 113 deps += [ 114 "gaussdb_rd:gaussdb_rd", 115 "//third_party/jsoncpp:jsoncpp", 116 "//third_party/openssl:libcrypto_shared", 117 ] 118 119 external_deps = [ 120 "c_utils:utils", 121 "ffrt:libffrt", 122 "hilog:libhilog", 123 "hisysevent:libhisysevent", 124 "hitrace:hitrace_meter", 125 ] 126 127 subsystem_name = "distributeddatamgr" 128 innerapi_tags = [ "platformsdk_indirect" ] 129 part_name = "kv_store" 130} 131