• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2022 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("//build/ohos/ace/ace.gni")
15import("//foundation/distributeddatamgr/data_share/datashare.gni")
16import("//foundation/distributeddatamgr/relational_store/relational_store.gni")
17
18ohos_copy("relational_store_declaration") {
19  sources = [ "./api" ]
20  outputs = [ target_out_dir + "/$target_name/" ]
21  module_source_dir = target_out_dir + "/$target_name"
22  module_install_name = ""
23}
24
25ohos_shared_library("relationalstore") {
26  sources = [
27    "src/entry_point.cpp",
28    "src/napi_async_call.cpp",
29    "src/napi_rdb_const_properties.cpp",
30    "src/napi_rdb_predicates.cpp",
31    "src/napi_rdb_store.cpp",
32    "src/napi_rdb_store_helper.cpp",
33    "src/napi_result_set.cpp",
34    "src/napi_uv_queue.cpp",
35  ]
36
37  if (is_mingw || is_mac) {
38    include_dirs = [
39      "mock/include",
40      "${relational_store_js_common_path}/mock/include",
41      "${relational_store_napi_path}/relationalstore/mock/include",
42      "//commonlibrary/c_utils/base/include",
43      "include",
44      "${relational_store_js_common_path}/include",
45    ]
46    cflags_cc = [
47      "-std=c++17",
48      "-stdlib=libc++",
49    ]
50    if (is_mac) {
51      buildos = "mac"
52      defines = [ "MAC_PLATFORM" ]
53    } else {
54      buildos = "windows"
55      defines = [ "WINDOWS_PLATFORM" ]
56    }
57    sources += [
58      "${relational_store_js_common_path}/mock/src/js_ability.cpp",
59      "${relational_store_js_common_path}/mock/src/js_utils.cpp",
60    ]
61    deps = [
62      "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog_${buildos}",
63      "//foundation/arkui/napi:ace_napi",
64      "//foundation/distributeddatamgr/relational_store/interfaces/inner_api/rdb:native_rdb",
65    ]
66  } else {
67    include_dirs = [
68      "include",
69      "${relational_store_js_common_path}/include",
70      "${relational_store_napi_path}/relationalstore/include",
71      "${datashare_base_path}/interfaces/inner_api/common/include/",
72    ]
73    defines = [ "SQLITE_DISTRIBUTE_RELATIONAL" ]
74    sources += [
75      "${relational_store_js_common_path}/src/js_ability.cpp",
76      "${relational_store_js_common_path}/src/js_utils.cpp",
77      "src/napi_rdb_store_observer.cpp",
78    ]
79
80    external_deps = [
81      "ability_runtime:abilitykit_native",
82      "ability_runtime:napi_base_context",
83      "c_utils:utils",
84      "hilog_native:libhilog",
85      "hitrace_native:hitrace_meter",
86      "napi:ace_napi",
87      "relational_store:native_appdatafwk",
88      "relational_store:native_rdb",
89      "relational_store:rdb_data_share_adapter",
90    ]
91  }
92
93  subsystem_name = "distributeddatamgr"
94  part_name = "relational_store"
95  relative_install_dir = "module/data"
96}
97