106694b06Sopenharmony_ci# Copyright (c) 2022 Huawei Device Co., Ltd.
206694b06Sopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License");
306694b06Sopenharmony_ci# you may not use this file except in compliance with the License.
406694b06Sopenharmony_ci# You may obtain a copy of the License at
506694b06Sopenharmony_ci#
606694b06Sopenharmony_ci#     http://www.apache.org/licenses/LICENSE-2.0
706694b06Sopenharmony_ci#
806694b06Sopenharmony_ci# Unless required by applicable law or agreed to in writing, software
906694b06Sopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS,
1006694b06Sopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1106694b06Sopenharmony_ci# See the License for the specific language governing permissions and
1206694b06Sopenharmony_ci# limitations under the License.
1306694b06Sopenharmony_ci
1406694b06Sopenharmony_ciimport("//build/ohos.gni")
1506694b06Sopenharmony_ciimport("//build/ohos/ace/ace.gni")
1606694b06Sopenharmony_ciimport("//foundation/distributeddatamgr/relational_store/relational_store.gni")
1706694b06Sopenharmony_ci
1806694b06Sopenharmony_ciohos_shared_library("cj_relational_store_ffi") {
1906694b06Sopenharmony_ci  sanitize = {
2006694b06Sopenharmony_ci    boundary_sanitize = true
2106694b06Sopenharmony_ci    ubsan = true
2206694b06Sopenharmony_ci    cfi = true
2306694b06Sopenharmony_ci    cfi_cross_dso = true
2406694b06Sopenharmony_ci    debug = false
2506694b06Sopenharmony_ci  }
2606694b06Sopenharmony_ci
2706694b06Sopenharmony_ci  include_dirs = [
2806694b06Sopenharmony_ci    "include",
2906694b06Sopenharmony_ci    "${relational_store_common_path}/include",
3006694b06Sopenharmony_ci    "${relational_store_js_common_path}/include",
3106694b06Sopenharmony_ci    "${relational_store_napi_path}/relationalstore/include",
3206694b06Sopenharmony_ci  ]
3306694b06Sopenharmony_ci
3406694b06Sopenharmony_ci  if (product_name != "ohos-sdk") {
3506694b06Sopenharmony_ci    sources = [
3606694b06Sopenharmony_ci      "src/relational_store_ffi.cpp",
3706694b06Sopenharmony_ci      "src/relational_store_impl_rdbpredicatesproxy.cpp",
3806694b06Sopenharmony_ci      "src/relational_store_impl_rdbstore.cpp",
3906694b06Sopenharmony_ci      "src/relational_store_impl_resultsetproxy.cpp",
4006694b06Sopenharmony_ci      "src/relational_store_utils.cpp",
4106694b06Sopenharmony_ci    ]
4206694b06Sopenharmony_ci
4306694b06Sopenharmony_ci    deps = [
4406694b06Sopenharmony_ci      "${relational_store_innerapi_path}/appdatafwk:native_appdatafwk",
4506694b06Sopenharmony_ci      "${relational_store_innerapi_path}/rdb:native_rdb",
4606694b06Sopenharmony_ci      "${relational_store_innerapi_path}/rdb_data_share_adapter:rdb_data_share_adapter",
4706694b06Sopenharmony_ci      "${relational_store_napi_path}/rdb:napi_rdb",
4806694b06Sopenharmony_ci      "${relational_store_napi_path}/relationalstore:relationalstore",
4906694b06Sopenharmony_ci    ]
5006694b06Sopenharmony_ci
5106694b06Sopenharmony_ci    external_deps = [
5206694b06Sopenharmony_ci      "ability_runtime:abilitykit_native",
5306694b06Sopenharmony_ci      "ability_runtime:napi_base_context",
5406694b06Sopenharmony_ci      "c_utils:utils",
5506694b06Sopenharmony_ci      "common_event_service:cesfwk_innerkits",
5606694b06Sopenharmony_ci      "hilog:libhilog",
5706694b06Sopenharmony_ci      "hitrace:hitrace_meter",
5806694b06Sopenharmony_ci      "napi:ace_napi",
5906694b06Sopenharmony_ci      "napi:cj_bind_ffi",
6006694b06Sopenharmony_ci      "napi:cj_bind_native",
6106694b06Sopenharmony_ci    ]
6206694b06Sopenharmony_ci  } else {
6306694b06Sopenharmony_ci    defines += [ "PREVIEWER" ]
6406694b06Sopenharmony_ci    sources = [ "mock/relational_store_mock.cpp" ]
6506694b06Sopenharmony_ci  }
6606694b06Sopenharmony_ci  innerapi_tags = [ "platformsdk" ]
6706694b06Sopenharmony_ci  subsystem_name = "distributeddatamgr"
6806694b06Sopenharmony_ci  part_name = "relational_store"
6906694b06Sopenharmony_ci}
70