• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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    "communicator/include",
28    "storage/include",
29    "storage/src",
30    "storage/src/multiver",
31    "storage/src/operation",
32    "storage/src/sqlite",
33    "storage/src/sqlite/relational",
34    "storage/src/upgrader",
35    "storage/src/cloud",
36    "syncer/include",
37    "syncer/src",
38    "syncer/src/cloud",
39    "//third_party/openssl/include/",
40  ]
41
42  defines = [
43    "_LARGEFILE64_SOURCE",
44    "_FILE_OFFSET_BITS=64",
45    "SQLITE_HAS_CODEC",
46    "SQLITE_ENABLE_JSON1",
47    "USING_HILOG_LOGGER",
48    "USE_SQLITE_SYMBOLS",
49    "USING_DB_JSON_EXTRACT_AUTOMATICALLY",
50    "JSONCPP_USE_BUILDER",
51    "OMIT_FLATBUFFER",
52    "OMIT_MULTI_VER",
53    "RELATIONAL_STORE",
54    "MANNUAL_SYNC_AND_CLEAN_CLOUD_DATA",
55    "SQLITE_DISTRIBUTE_RELATIONAL",
56    "USE_DFX_ABILITY",
57    "SQLITE_ENABLE_DROPTABLE_CALLBACK",
58    "OPENSSL_SUPPRESS_DEPRECATED",
59    "MAX_UPLOAD_COUNT=30",
60  ]
61  if (is_debug) {
62    defines += [ "TRACE_SQLITE_EXECUTE" ]
63  }
64}
65
66config("distrdb_public_config") {
67  visibility = [ "*:*" ]
68  include_dirs = [
69    "interfaces/include",
70    "interfaces/include/relational",
71    "include",
72  ]
73}
74
75group("build_module") {
76  deps = [ ":distributeddb" ]
77}
78
79ohos_shared_library("distributeddb") {
80  sources = distributeddb_src
81
82  configs = [ ":distrdb_config" ]
83  public_configs = [ ":distrdb_public_config" ]
84
85  deps = [
86    "//third_party/sqlite:sqlite",
87    "//third_party/zlib:shared_libz",
88  ]
89
90  configs += [ "//third_party/jsoncpp:jsoncpp_config" ]
91  ldflags = [ "-Wl,--exclude-libs,ALL" ]
92  cflags_cc = [ "-fvisibility=hidden" ]
93  deps += [
94    "//third_party/jsoncpp:jsoncpp",
95    "//third_party/openssl:libcrypto_shared",
96  ]
97
98  external_deps = [
99    "c_utils:utils",
100    "hilog:libhilog",
101    "hisysevent:libhisysevent",
102    "hitrace:hitrace_meter",
103  ]
104
105  subsystem_name = "distributeddatamgr"
106  innerapi_tags = [ "platformsdk_indirect" ]
107  part_name = "kv_store"
108}
109