106694b06Sopenharmony_ci# Copyright (c) 2021 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_ciimport("//build/ohos.gni")
1406694b06Sopenharmony_ciimport("//foundation/distributeddatamgr/relational_store/relational_store.gni")
1506694b06Sopenharmony_ci
1606694b06Sopenharmony_cibase_sources = [
1706694b06Sopenharmony_ci  "${relational_store_native_path}/rdb/src/abs_predicates.cpp",
1806694b06Sopenharmony_ci  "${relational_store_native_path}/rdb/src/abs_rdb_predicates.cpp",
1906694b06Sopenharmony_ci  "${relational_store_native_path}/rdb/src/abs_result_set.cpp",
2006694b06Sopenharmony_ci  "${relational_store_native_path}/rdb/src/base_transaction.cpp",
2106694b06Sopenharmony_ci  "${relational_store_native_path}/rdb/src/big_integer.cpp",
2206694b06Sopenharmony_ci  "${relational_store_native_path}/rdb/src/cache_result_set.cpp",
2306694b06Sopenharmony_ci  "${relational_store_native_path}/rdb/src/connection.cpp",
2406694b06Sopenharmony_ci  "${relational_store_native_path}/rdb/src/connection_pool.cpp",
2506694b06Sopenharmony_ci  "${relational_store_native_path}/rdb/src/raw_data_parser.cpp",
2606694b06Sopenharmony_ci  "${relational_store_native_path}/rdb/src/rdb_helper.cpp",
2706694b06Sopenharmony_ci  "${relational_store_native_path}/rdb/src/rdb_local_db_observer.cpp",
2806694b06Sopenharmony_ci  "${relational_store_native_path}/rdb/src/rdb_predicates.cpp",
2906694b06Sopenharmony_ci  "${relational_store_native_path}/rdb/src/rdb_security_manager.cpp",
3006694b06Sopenharmony_ci  "${relational_store_native_path}/rdb/src/rdb_sql_statistic.cpp",
3106694b06Sopenharmony_ci  "${relational_store_native_path}/rdb/src/rdb_sql_utils.cpp",
3206694b06Sopenharmony_ci  "${relational_store_native_path}/rdb/src/rdb_store.cpp",
3306694b06Sopenharmony_ci  "${relational_store_native_path}/rdb/src/rdb_store_config.cpp",
3406694b06Sopenharmony_ci  "${relational_store_native_path}/rdb/src/rdb_store_impl.cpp",
3506694b06Sopenharmony_ci  "${relational_store_native_path}/rdb/src/rdb_store_manager.cpp",
3606694b06Sopenharmony_ci  "${relational_store_native_path}/rdb/src/sqlite_connection.cpp",
3706694b06Sopenharmony_ci  "${relational_store_native_path}/rdb/src/sqlite_global_config.cpp",
3806694b06Sopenharmony_ci  "${relational_store_native_path}/rdb/src/sqlite_sql_builder.cpp",
3906694b06Sopenharmony_ci  "${relational_store_native_path}/rdb/src/sqlite_statement.cpp",
4006694b06Sopenharmony_ci  "${relational_store_native_path}/rdb/src/sqlite_utils.cpp",
4106694b06Sopenharmony_ci  "${relational_store_native_path}/rdb/src/step_result_set.cpp",
4206694b06Sopenharmony_ci  "${relational_store_native_path}/rdb/src/string_utils.cpp",
4306694b06Sopenharmony_ci  "${relational_store_native_path}/rdb/src/trans_db.cpp",
4406694b06Sopenharmony_ci  "${relational_store_native_path}/rdb/src/transaction.cpp",
4506694b06Sopenharmony_ci  "${relational_store_native_path}/rdb/src/transaction_impl.cpp",
4606694b06Sopenharmony_ci  "${relational_store_native_path}/rdb/src/value_object.cpp",
4706694b06Sopenharmony_ci  "${relational_store_native_path}/rdb/src/values_bucket.cpp",
4806694b06Sopenharmony_ci  "${relational_store_native_path}/rdb/src/values_buckets.cpp",
4906694b06Sopenharmony_ci]
5006694b06Sopenharmony_ci
5106694b06Sopenharmony_ciif (!is_ohos) {
5206694b06Sopenharmony_ci  base_sources += [
5306694b06Sopenharmony_ci    "${relational_store_mock_path}/frameworks/native/rdb/mock.cpp",
5406694b06Sopenharmony_ci    "${relational_store_native_path}/rdb/mock/src/rdb_fault_hiview_reporter.cpp",
5506694b06Sopenharmony_ci  ]
5606694b06Sopenharmony_ci}
5706694b06Sopenharmony_ci
5806694b06Sopenharmony_ciif (is_ohos && !build_ohos_sdk) {
5906694b06Sopenharmony_ci  config("native_rdb_config") {
6006694b06Sopenharmony_ci    visibility = [ ":*" ]
6106694b06Sopenharmony_ci
6206694b06Sopenharmony_ci    include_dirs = [
6306694b06Sopenharmony_ci      "include",
6406694b06Sopenharmony_ci      "${relational_store_common_path}/include",
6506694b06Sopenharmony_ci      "${relational_store_native_path}/rdb/include",
6606694b06Sopenharmony_ci      "${relational_store_native_path}/dfx/include",
6706694b06Sopenharmony_ci      "${relational_store_native_path}/rdb_device_manager_adapter/include",
6806694b06Sopenharmony_ci    ]
6906694b06Sopenharmony_ci
7006694b06Sopenharmony_ci    defines = [
7106694b06Sopenharmony_ci      "RELATIONAL_STORE",
7206694b06Sopenharmony_ci      "SQLITE_HAS_CODEC",
7306694b06Sopenharmony_ci      "RDB_TRACE_ON",
7406694b06Sopenharmony_ci    ]
7506694b06Sopenharmony_ci
7606694b06Sopenharmony_ci    if (relational_store_rdb_support_icu) {
7706694b06Sopenharmony_ci      include_dirs += [
7806694b06Sopenharmony_ci        "//third_party/icu/icu4c/source",
7906694b06Sopenharmony_ci        "//third_party/icu/icu4c/source/i18n",
8006694b06Sopenharmony_ci        "//third_party/icu/icu4c/source/common",
8106694b06Sopenharmony_ci      ]
8206694b06Sopenharmony_ci      defines += [ "RDB_SUPPORT_ICU" ]
8306694b06Sopenharmony_ci    }
8406694b06Sopenharmony_ci
8506694b06Sopenharmony_ci    defines += [ "SQLITE_DISTRIBUTE_RELATIONAL" ]
8606694b06Sopenharmony_ci    include_dirs += [
8706694b06Sopenharmony_ci      "${kvstore_path}/common",
8806694b06Sopenharmony_ci      "${kvstore_interface_path}",
8906694b06Sopenharmony_ci      "${distributedfile_path}/mod_securitylabel",
9006694b06Sopenharmony_ci    ]
9106694b06Sopenharmony_ci  }
9206694b06Sopenharmony_ci
9306694b06Sopenharmony_ci  config("native_rdb_public_config") {
9406694b06Sopenharmony_ci    visibility = [ ":*" ]
9506694b06Sopenharmony_ci
9606694b06Sopenharmony_ci    include_dirs = [
9706694b06Sopenharmony_ci      "include",
9806694b06Sopenharmony_ci      "${relational_store_native_path}/rdb/include",
9906694b06Sopenharmony_ci      "${relational_store_native_path}/dfx/include",
10006694b06Sopenharmony_ci      "../cloud_data/include",
10106694b06Sopenharmony_ci      "../common_type/include",
10206694b06Sopenharmony_ci    ]
10306694b06Sopenharmony_ci  }
10406694b06Sopenharmony_ci
10506694b06Sopenharmony_ci  base_deps = [
10606694b06Sopenharmony_ci    "//third_party/icu/icu4c:shared_icui18n",
10706694b06Sopenharmony_ci    "//third_party/icu/icu4c:shared_icuuc",
10806694b06Sopenharmony_ci  ]
10906694b06Sopenharmony_ci
11006694b06Sopenharmony_ci  ohos_shared_library("native_rdb") {
11106694b06Sopenharmony_ci    branch_protector_ret = "pac_ret"
11206694b06Sopenharmony_ci    sanitize = {
11306694b06Sopenharmony_ci      boundary_sanitize = true
11406694b06Sopenharmony_ci      ubsan = true
11506694b06Sopenharmony_ci      cfi = true
11606694b06Sopenharmony_ci      cfi_cross_dso = true
11706694b06Sopenharmony_ci      debug = false
11806694b06Sopenharmony_ci    }
11906694b06Sopenharmony_ci
12006694b06Sopenharmony_ci    part_name = "relational_store"
12106694b06Sopenharmony_ci    sources = base_sources
12206694b06Sopenharmony_ci
12306694b06Sopenharmony_ci    configs = [ ":native_rdb_config" ]
12406694b06Sopenharmony_ci
12506694b06Sopenharmony_ci    deps = base_deps
12606694b06Sopenharmony_ci
12706694b06Sopenharmony_ci    deps += [ "//third_party/sqlite:sqlite" ]
12806694b06Sopenharmony_ci    ldflags = [ "-Wl,--exclude-libs,ALL" ]
12906694b06Sopenharmony_ci    cflags_cc = [ "-fvisibility=hidden" ]
13006694b06Sopenharmony_ci    sources += [
13106694b06Sopenharmony_ci      "${relational_store_native_path}/dfx/src/rdb_fault_hiview_reporter.cpp",
13206694b06Sopenharmony_ci      "${relational_store_native_path}/dfx/src/rdb_radar_reporter.cpp",
13306694b06Sopenharmony_ci      "${relational_store_native_path}/rdb/src/abs_shared_result_set.cpp",
13406694b06Sopenharmony_ci      "${relational_store_native_path}/rdb/src/delay_notify.cpp",
13506694b06Sopenharmony_ci      "${relational_store_native_path}/rdb/src/grd_api_manager.cpp",
13606694b06Sopenharmony_ci      "${relational_store_native_path}/rdb/src/rd_connection.cpp",
13706694b06Sopenharmony_ci      "${relational_store_native_path}/rdb/src/rd_statement.cpp",
13806694b06Sopenharmony_ci      "${relational_store_native_path}/rdb/src/rd_utils.cpp",
13906694b06Sopenharmony_ci      "${relational_store_native_path}/rdb/src/rdb_manager_impl.cpp",
14006694b06Sopenharmony_ci      "${relational_store_native_path}/rdb/src/rdb_notifier_stub.cpp",
14106694b06Sopenharmony_ci      "${relational_store_native_path}/rdb/src/rdb_service_proxy.cpp",
14206694b06Sopenharmony_ci      "${relational_store_native_path}/rdb/src/rdb_types_util.cpp",
14306694b06Sopenharmony_ci      "${relational_store_native_path}/rdb/src/result_set_proxy.cpp",
14406694b06Sopenharmony_ci      "${relational_store_native_path}/rdb/src/security_policy.cpp",
14506694b06Sopenharmony_ci      "${relational_store_native_path}/rdb/src/share_block.cpp",
14606694b06Sopenharmony_ci      "${relational_store_native_path}/rdb/src/shared_block_serializer_info.cpp",
14706694b06Sopenharmony_ci      "${relational_store_native_path}/rdb/src/sqlite_shared_result_set.cpp",
14806694b06Sopenharmony_ci      "${relational_store_native_path}/rdb/src/task_executor.cpp",
14906694b06Sopenharmony_ci      "${relational_store_native_path}/rdb_device_manager_adapter/src/rdb_device_manager_adapter.cpp",
15006694b06Sopenharmony_ci    ]
15106694b06Sopenharmony_ci
15206694b06Sopenharmony_ci    public_deps = [
15306694b06Sopenharmony_ci      "${relational_store_innerapi_path}/appdatafwk:native_appdatafwk",
15406694b06Sopenharmony_ci      "${relational_store_innerapi_path}/appdatafwk:relational_common_base",
15506694b06Sopenharmony_ci    ]
15606694b06Sopenharmony_ci
15706694b06Sopenharmony_ci    external_deps = [
15806694b06Sopenharmony_ci      "ability_base:zuri",
15906694b06Sopenharmony_ci      "ability_runtime:dataobs_manager",
16006694b06Sopenharmony_ci      "access_token:libaccesstoken_sdk",
16106694b06Sopenharmony_ci      "c_utils:utils",
16206694b06Sopenharmony_ci      "device_manager:devicemanagersdk",
16306694b06Sopenharmony_ci      "hilog:libhilog",
16406694b06Sopenharmony_ci      "hisysevent:libhisysevent",
16506694b06Sopenharmony_ci      "hitrace:hitrace_meter",
16606694b06Sopenharmony_ci      "huks:libhukssdk",
16706694b06Sopenharmony_ci      "ipc:ipc_core",
16806694b06Sopenharmony_ci      "kv_store:database_utils",
16906694b06Sopenharmony_ci      "kv_store:distributeddb",
17006694b06Sopenharmony_ci      "samgr:samgr_proxy",
17106694b06Sopenharmony_ci    ]
17206694b06Sopenharmony_ci
17306694b06Sopenharmony_ci    public_configs = [ ":native_rdb_public_config" ]
17406694b06Sopenharmony_ci    innerapi_tags = [
17506694b06Sopenharmony_ci      "platformsdk",
17606694b06Sopenharmony_ci      "sasdk",
17706694b06Sopenharmony_ci    ]
17806694b06Sopenharmony_ci    subsystem_name = "distributeddatamgr"
17906694b06Sopenharmony_ci  }
18006694b06Sopenharmony_ci
18106694b06Sopenharmony_ci  ohos_static_library("native_rdb_static") {
18206694b06Sopenharmony_ci    branch_protector_ret = "pac_ret"
18306694b06Sopenharmony_ci    sanitize = {
18406694b06Sopenharmony_ci      boundary_sanitize = true
18506694b06Sopenharmony_ci      ubsan = true
18606694b06Sopenharmony_ci      cfi = true
18706694b06Sopenharmony_ci      cfi_cross_dso = true
18806694b06Sopenharmony_ci      debug = false
18906694b06Sopenharmony_ci    }
19006694b06Sopenharmony_ci
19106694b06Sopenharmony_ci    sources = base_sources
19206694b06Sopenharmony_ci
19306694b06Sopenharmony_ci    configs = [ ":native_rdb_config" ]
19406694b06Sopenharmony_ci
19506694b06Sopenharmony_ci    deps = base_deps
19606694b06Sopenharmony_ci
19706694b06Sopenharmony_ci    deps += [ "//third_party/sqlite:sqlite" ]
19806694b06Sopenharmony_ci    ldflags = [ "-Wl,--exclude-libs,ALL" ]
19906694b06Sopenharmony_ci
20006694b06Sopenharmony_ci    sources += [
20106694b06Sopenharmony_ci      "${relational_store_native_path}/dfx/src/rdb_fault_hiview_reporter.cpp",
20206694b06Sopenharmony_ci      "${relational_store_native_path}/dfx/src/rdb_radar_reporter.cpp",
20306694b06Sopenharmony_ci      "${relational_store_native_path}/rdb/src/abs_shared_result_set.cpp",
20406694b06Sopenharmony_ci      "${relational_store_native_path}/rdb/src/delay_notify.cpp",
20506694b06Sopenharmony_ci      "${relational_store_native_path}/rdb/src/grd_api_manager.cpp",
20606694b06Sopenharmony_ci      "${relational_store_native_path}/rdb/src/rd_connection.cpp",
20706694b06Sopenharmony_ci      "${relational_store_native_path}/rdb/src/rd_statement.cpp",
20806694b06Sopenharmony_ci      "${relational_store_native_path}/rdb/src/rd_utils.cpp",
20906694b06Sopenharmony_ci      "${relational_store_native_path}/rdb/src/rdb_manager_impl.cpp",
21006694b06Sopenharmony_ci      "${relational_store_native_path}/rdb/src/rdb_notifier_stub.cpp",
21106694b06Sopenharmony_ci      "${relational_store_native_path}/rdb/src/rdb_service_proxy.cpp",
21206694b06Sopenharmony_ci      "${relational_store_native_path}/rdb/src/rdb_types_util.cpp",
21306694b06Sopenharmony_ci      "${relational_store_native_path}/rdb/src/result_set_proxy.cpp",
21406694b06Sopenharmony_ci      "${relational_store_native_path}/rdb/src/security_policy.cpp",
21506694b06Sopenharmony_ci      "${relational_store_native_path}/rdb/src/share_block.cpp",
21606694b06Sopenharmony_ci      "${relational_store_native_path}/rdb/src/shared_block_serializer_info.cpp",
21706694b06Sopenharmony_ci      "${relational_store_native_path}/rdb/src/sqlite_shared_result_set.cpp",
21806694b06Sopenharmony_ci      "${relational_store_native_path}/rdb/src/task_executor.cpp",
21906694b06Sopenharmony_ci      "${relational_store_native_path}/rdb_device_manager_adapter/src/rdb_device_manager_adapter.cpp",
22006694b06Sopenharmony_ci    ]
22106694b06Sopenharmony_ci
22206694b06Sopenharmony_ci    public_deps = [
22306694b06Sopenharmony_ci      "${relational_store_innerapi_path}/appdatafwk:native_appdatafwk",
22406694b06Sopenharmony_ci      "${relational_store_innerapi_path}/appdatafwk:relational_common_base",
22506694b06Sopenharmony_ci    ]
22606694b06Sopenharmony_ci
22706694b06Sopenharmony_ci    external_deps = [
22806694b06Sopenharmony_ci      "ability_base:zuri",
22906694b06Sopenharmony_ci      "ability_runtime:dataobs_manager",
23006694b06Sopenharmony_ci      "access_token:libaccesstoken_sdk",
23106694b06Sopenharmony_ci      "c_utils:utils",
23206694b06Sopenharmony_ci      "device_manager:devicemanagersdk",
23306694b06Sopenharmony_ci      "hilog:libhilog",
23406694b06Sopenharmony_ci      "hisysevent:libhisysevent",
23506694b06Sopenharmony_ci      "hitrace:hitrace_meter",
23606694b06Sopenharmony_ci      "huks:libhukssdk",
23706694b06Sopenharmony_ci      "ipc:ipc_core",
23806694b06Sopenharmony_ci      "kv_store:database_utils",
23906694b06Sopenharmony_ci      "kv_store:distributeddb",
24006694b06Sopenharmony_ci      "samgr:samgr_proxy",
24106694b06Sopenharmony_ci    ]
24206694b06Sopenharmony_ci
24306694b06Sopenharmony_ci    public_configs = [ ":native_rdb_public_config" ]
24406694b06Sopenharmony_ci
24506694b06Sopenharmony_ci    subsystem_name = "distributeddatamgr"
24606694b06Sopenharmony_ci    part_name = "relational_store"
24706694b06Sopenharmony_ci  }
24806694b06Sopenharmony_ci} else if (is_mingw) {
24906694b06Sopenharmony_ci  config("native_rdb_config") {
25006694b06Sopenharmony_ci    visibility = [ ":*" ]
25106694b06Sopenharmony_ci
25206694b06Sopenharmony_ci    include_dirs = [
25306694b06Sopenharmony_ci      "${relational_store_mock_path}/frameworks/native/rdb",
25406694b06Sopenharmony_ci      "${relational_store_mock_path}/frameworks/native/win32",
25506694b06Sopenharmony_ci      "mock/include",
25606694b06Sopenharmony_ci      "${relational_store_common_path}/include",
25706694b06Sopenharmony_ci      "${relational_store_native_path}/rdb/mock/include",
25806694b06Sopenharmony_ci      "//commonlibrary/c_utils/base/include",
25906694b06Sopenharmony_ci      "include",
26006694b06Sopenharmony_ci      "//foundation/communication/ipc/interfaces/innerkits/ipc_core/include",
26106694b06Sopenharmony_ci      "${relational_store_native_path}/rdb/include",
26206694b06Sopenharmony_ci      "${relational_store_native_path}/dfx/include",
26306694b06Sopenharmony_ci      "//third_party/libuv/src/win",
26406694b06Sopenharmony_ci    ]
26506694b06Sopenharmony_ci
26606694b06Sopenharmony_ci    cflags = [ "-includemock.h" ]
26706694b06Sopenharmony_ci    defines = [
26806694b06Sopenharmony_ci      "RELATIONAL_STORE",
26906694b06Sopenharmony_ci      "SQLITE_HAS_CODEC",
27006694b06Sopenharmony_ci    ]
27106694b06Sopenharmony_ci
27206694b06Sopenharmony_ci    if (relational_store_rdb_support_icu) {
27306694b06Sopenharmony_ci      include_dirs += [
27406694b06Sopenharmony_ci        "//third_party/icu/icu4c/source",
27506694b06Sopenharmony_ci        "//third_party/icu/icu4c/source/i18n",
27606694b06Sopenharmony_ci        "//third_party/icu/icu4c/source/common",
27706694b06Sopenharmony_ci      ]
27806694b06Sopenharmony_ci      defines += [ "RDB_SUPPORT_ICU" ]
27906694b06Sopenharmony_ci    }
28006694b06Sopenharmony_ci
28106694b06Sopenharmony_ci    defines += [
28206694b06Sopenharmony_ci      "WINDOWS_PLATFORM",
28306694b06Sopenharmony_ci      "CROSS_PLATFORM",
28406694b06Sopenharmony_ci    ]
28506694b06Sopenharmony_ci    include_dirs += [
28606694b06Sopenharmony_ci      "//foundation/distributeddatamgr/kv_store/frameworks/common",
28706694b06Sopenharmony_ci      "//third_party/sqlite/include",
28806694b06Sopenharmony_ci    ]
28906694b06Sopenharmony_ci    libs = [ "//prebuilts/mingw-w64/ohos/linux-x86_64/clang-mingw/x86_64-w64-mingw32/lib/libws2_32.a" ]
29006694b06Sopenharmony_ci  }
29106694b06Sopenharmony_ci
29206694b06Sopenharmony_ci  config("native_rdb_public_config") {
29306694b06Sopenharmony_ci    visibility = [ ":*" ]
29406694b06Sopenharmony_ci
29506694b06Sopenharmony_ci    include_dirs = [
29606694b06Sopenharmony_ci      "mock/include",
29706694b06Sopenharmony_ci      "include",
29806694b06Sopenharmony_ci      "//third_party/libuv/src/win",
29906694b06Sopenharmony_ci      "../cloud_data/include",
30006694b06Sopenharmony_ci      "../common_type/include",
30106694b06Sopenharmony_ci    ]
30206694b06Sopenharmony_ci  }
30306694b06Sopenharmony_ci
30406694b06Sopenharmony_ci  base_deps = [
30506694b06Sopenharmony_ci    "//third_party/icu/icu4c:shared_icui18n",
30606694b06Sopenharmony_ci    "//third_party/icu/icu4c:shared_icuuc",
30706694b06Sopenharmony_ci  ]
30806694b06Sopenharmony_ci
30906694b06Sopenharmony_ci  ohos_shared_library("native_rdb") {
31006694b06Sopenharmony_ci    part_name = "relational_store"
31106694b06Sopenharmony_ci    sources = base_sources
31206694b06Sopenharmony_ci
31306694b06Sopenharmony_ci    configs = [ ":native_rdb_config" ]
31406694b06Sopenharmony_ci
31506694b06Sopenharmony_ci    deps = base_deps
31606694b06Sopenharmony_ci
31706694b06Sopenharmony_ci    sources += [
31806694b06Sopenharmony_ci      "${relational_store_native_path}/rdb/mock/src/rdb_radar_reporter.cpp",
31906694b06Sopenharmony_ci      "${relational_store_native_path}/rdb/mock/src/task_executor.cpp",
32006694b06Sopenharmony_ci    ]
32106694b06Sopenharmony_ci
32206694b06Sopenharmony_ci    deps += [
32306694b06Sopenharmony_ci      "${relational_store_innerapi_path}/appdatafwk:relational_common_base",
32406694b06Sopenharmony_ci      "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog_windows",
32506694b06Sopenharmony_ci      "//third_party/sqlite:sqlite_sdk",
32606694b06Sopenharmony_ci    ]
32706694b06Sopenharmony_ci
32806694b06Sopenharmony_ci    cflags_cc = [ "-std=c++17" ]
32906694b06Sopenharmony_ci
33006694b06Sopenharmony_ci    public_configs = [ ":native_rdb_public_config" ]
33106694b06Sopenharmony_ci    innerapi_tags = [ "platformsdk" ]
33206694b06Sopenharmony_ci    subsystem_name = "distributeddatamgr"
33306694b06Sopenharmony_ci  }
33406694b06Sopenharmony_ci
33506694b06Sopenharmony_ci  ohos_static_library("native_rdb_static") {
33606694b06Sopenharmony_ci    sources = base_sources
33706694b06Sopenharmony_ci
33806694b06Sopenharmony_ci    configs = [ ":native_rdb_config" ]
33906694b06Sopenharmony_ci
34006694b06Sopenharmony_ci    deps = base_deps
34106694b06Sopenharmony_ci
34206694b06Sopenharmony_ci    sources += [
34306694b06Sopenharmony_ci      "${relational_store_native_path}/rdb/mock/src/rdb_radar_reporter.cpp",
34406694b06Sopenharmony_ci      "${relational_store_native_path}/rdb/mock/src/task_executor.cpp",
34506694b06Sopenharmony_ci    ]
34606694b06Sopenharmony_ci
34706694b06Sopenharmony_ci    deps += [
34806694b06Sopenharmony_ci      "${relational_store_innerapi_path}/appdatafwk:relational_common_base",
34906694b06Sopenharmony_ci      "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog_windows",
35006694b06Sopenharmony_ci      "//third_party/sqlite:sqlite_sdk",
35106694b06Sopenharmony_ci    ]
35206694b06Sopenharmony_ci    cflags_cc = [ "-std=c++17" ]
35306694b06Sopenharmony_ci
35406694b06Sopenharmony_ci    public_configs = [ ":native_rdb_public_config" ]
35506694b06Sopenharmony_ci
35606694b06Sopenharmony_ci    subsystem_name = "distributeddatamgr"
35706694b06Sopenharmony_ci    part_name = "relational_store"
35806694b06Sopenharmony_ci  }
35906694b06Sopenharmony_ci} else if (is_mac) {
36006694b06Sopenharmony_ci  config("native_rdb_config") {
36106694b06Sopenharmony_ci    visibility = [ ":*" ]
36206694b06Sopenharmony_ci
36306694b06Sopenharmony_ci    include_dirs = [
36406694b06Sopenharmony_ci      "${relational_store_mock_path}/frameworks/native/rdb",
36506694b06Sopenharmony_ci      "mock/include",
36606694b06Sopenharmony_ci      "${relational_store_common_path}/include",
36706694b06Sopenharmony_ci      "${relational_store_native_path}/rdb/mock/include",
36806694b06Sopenharmony_ci      "//commonlibrary/c_utils/base/include",
36906694b06Sopenharmony_ci      "include",
37006694b06Sopenharmony_ci      "//foundation/communication/ipc/interfaces/innerkits/ipc_core/include",
37106694b06Sopenharmony_ci      "${relational_store_native_path}/rdb/include",
37206694b06Sopenharmony_ci      "${relational_store_native_path}/dfx/include",
37306694b06Sopenharmony_ci    ]
37406694b06Sopenharmony_ci
37506694b06Sopenharmony_ci    cflags = [ "-includemock.h" ]
37606694b06Sopenharmony_ci    defines = [
37706694b06Sopenharmony_ci      "RELATIONAL_STORE",
37806694b06Sopenharmony_ci      "SQLITE_HAS_CODEC",
37906694b06Sopenharmony_ci    ]
38006694b06Sopenharmony_ci
38106694b06Sopenharmony_ci    if (relational_store_rdb_support_icu) {
38206694b06Sopenharmony_ci      include_dirs += [
38306694b06Sopenharmony_ci        "//third_party/icu/icu4c/source",
38406694b06Sopenharmony_ci        "//third_party/icu/icu4c/source/i18n",
38506694b06Sopenharmony_ci        "//third_party/icu/icu4c/source/common",
38606694b06Sopenharmony_ci      ]
38706694b06Sopenharmony_ci      defines += [ "RDB_SUPPORT_ICU" ]
38806694b06Sopenharmony_ci    }
38906694b06Sopenharmony_ci
39006694b06Sopenharmony_ci    defines += [
39106694b06Sopenharmony_ci      "MAC_PLATFORM",
39206694b06Sopenharmony_ci      "CROSS_PLATFORM",
39306694b06Sopenharmony_ci    ]
39406694b06Sopenharmony_ci    include_dirs += [
39506694b06Sopenharmony_ci      "//foundation/distributeddatamgr/kv_store/frameworks/common",
39606694b06Sopenharmony_ci      "//third_party/sqlite/include",
39706694b06Sopenharmony_ci    ]
39806694b06Sopenharmony_ci  }
39906694b06Sopenharmony_ci
40006694b06Sopenharmony_ci  config("native_rdb_public_config") {
40106694b06Sopenharmony_ci    visibility = [ ":*" ]
40206694b06Sopenharmony_ci
40306694b06Sopenharmony_ci    include_dirs = [
40406694b06Sopenharmony_ci      "mock/include",
40506694b06Sopenharmony_ci      "include",
40606694b06Sopenharmony_ci      "../cloud_data/include",
40706694b06Sopenharmony_ci      "../common_type/include",
40806694b06Sopenharmony_ci    ]
40906694b06Sopenharmony_ci  }
41006694b06Sopenharmony_ci
41106694b06Sopenharmony_ci  base_deps = [
41206694b06Sopenharmony_ci    "//third_party/icu/icu4c:shared_icui18n",
41306694b06Sopenharmony_ci    "//third_party/icu/icu4c:shared_icuuc",
41406694b06Sopenharmony_ci  ]
41506694b06Sopenharmony_ci
41606694b06Sopenharmony_ci  ohos_shared_library("native_rdb") {
41706694b06Sopenharmony_ci    part_name = "relational_store"
41806694b06Sopenharmony_ci    sources = base_sources
41906694b06Sopenharmony_ci
42006694b06Sopenharmony_ci    configs = [ ":native_rdb_config" ]
42106694b06Sopenharmony_ci
42206694b06Sopenharmony_ci    deps = base_deps
42306694b06Sopenharmony_ci
42406694b06Sopenharmony_ci    sources += [
42506694b06Sopenharmony_ci      "${relational_store_native_path}/rdb/mock/src/rdb_radar_reporter.cpp",
42606694b06Sopenharmony_ci      "${relational_store_native_path}/rdb/mock/src/task_executor.cpp",
42706694b06Sopenharmony_ci    ]
42806694b06Sopenharmony_ci    deps += [
42906694b06Sopenharmony_ci      "${relational_store_innerapi_path}/appdatafwk:relational_common_base",
43006694b06Sopenharmony_ci      "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog_mac",
43106694b06Sopenharmony_ci      "//third_party/sqlite:sqlite_sdk",
43206694b06Sopenharmony_ci    ]
43306694b06Sopenharmony_ci    cflags_cc = [ "-std=c++17" ]
43406694b06Sopenharmony_ci
43506694b06Sopenharmony_ci    public_configs = [ ":native_rdb_public_config" ]
43606694b06Sopenharmony_ci    innerapi_tags = [ "platformsdk" ]
43706694b06Sopenharmony_ci    subsystem_name = "distributeddatamgr"
43806694b06Sopenharmony_ci  }
43906694b06Sopenharmony_ci
44006694b06Sopenharmony_ci  ohos_static_library("native_rdb_static") {
44106694b06Sopenharmony_ci    sources = base_sources
44206694b06Sopenharmony_ci
44306694b06Sopenharmony_ci    configs = [ ":native_rdb_config" ]
44406694b06Sopenharmony_ci
44506694b06Sopenharmony_ci    deps = base_deps
44606694b06Sopenharmony_ci
44706694b06Sopenharmony_ci    sources += [
44806694b06Sopenharmony_ci      "${relational_store_native_path}/rdb/mock/src/rdb_radar_reporter.cpp",
44906694b06Sopenharmony_ci      "${relational_store_native_path}/rdb/mock/src/task_executor.cpp",
45006694b06Sopenharmony_ci    ]
45106694b06Sopenharmony_ci    deps += [
45206694b06Sopenharmony_ci      "${relational_store_innerapi_path}/appdatafwk:relational_common_base",
45306694b06Sopenharmony_ci      "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog_mac",
45406694b06Sopenharmony_ci      "//third_party/sqlite:sqlite_sdk",
45506694b06Sopenharmony_ci    ]
45606694b06Sopenharmony_ci    cflags_cc = [ "-std=c++17" ]
45706694b06Sopenharmony_ci
45806694b06Sopenharmony_ci    public_configs = [ ":native_rdb_public_config" ]
45906694b06Sopenharmony_ci
46006694b06Sopenharmony_ci    subsystem_name = "distributeddatamgr"
46106694b06Sopenharmony_ci    part_name = "relational_store"
46206694b06Sopenharmony_ci  }
46306694b06Sopenharmony_ci} else if (is_android) {
46406694b06Sopenharmony_ci  config("native_rdb_config") {
46506694b06Sopenharmony_ci    visibility = [ ":*" ]
46606694b06Sopenharmony_ci
46706694b06Sopenharmony_ci    include_dirs = [
46806694b06Sopenharmony_ci      "${relational_store_mock_path}/frameworks/native/rdb",
46906694b06Sopenharmony_ci      "${distributedfile_path}/mod_securitylabel",
47006694b06Sopenharmony_ci      "${relational_store_common_path}/include",
47106694b06Sopenharmony_ci      "${relational_store_innerapi_path}/rdb/mock/include",
47206694b06Sopenharmony_ci      "${relational_store_native_path}/rdb/mock/include",
47306694b06Sopenharmony_ci      "${relational_store_innerapi_path}/rdb/include",
47406694b06Sopenharmony_ci      "${relational_store_native_path}/rdb/include",
47506694b06Sopenharmony_ci      "${relational_store_native_path}/dfx/include",
47606694b06Sopenharmony_ci    ]
47706694b06Sopenharmony_ci
47806694b06Sopenharmony_ci    cflags = [ "-includemock.h" ]
47906694b06Sopenharmony_ci    defines = [
48006694b06Sopenharmony_ci      "RELATIONAL_STORE",
48106694b06Sopenharmony_ci      "SQLITE_HAS_CODEC",
48206694b06Sopenharmony_ci    ]
48306694b06Sopenharmony_ci
48406694b06Sopenharmony_ci    if (relational_store_rdb_support_icu) {
48506694b06Sopenharmony_ci      include_dirs += [
48606694b06Sopenharmony_ci        "//third_party/icu/icu4c/source",
48706694b06Sopenharmony_ci        "//third_party/icu/icu4c/source/i18n",
48806694b06Sopenharmony_ci        "//third_party/icu/icu4c/source/common",
48906694b06Sopenharmony_ci      ]
49006694b06Sopenharmony_ci      defines += [ "RDB_SUPPORT_ICU" ]
49106694b06Sopenharmony_ci    }
49206694b06Sopenharmony_ci  }
49306694b06Sopenharmony_ci
49406694b06Sopenharmony_ci  config("native_rdb_public_config") {
49506694b06Sopenharmony_ci    visibility = [ ":*" ]
49606694b06Sopenharmony_ci
49706694b06Sopenharmony_ci    include_dirs = [
49806694b06Sopenharmony_ci      "mock/include",
49906694b06Sopenharmony_ci      "include",
50006694b06Sopenharmony_ci      "${relational_store_native_path}/mock/rdb/include",
50106694b06Sopenharmony_ci      "${relational_store_native_path}/rdb/include",
50206694b06Sopenharmony_ci      "${relational_store_native_path}/dfx/include",
50306694b06Sopenharmony_ci      "../cloud_data/include",
50406694b06Sopenharmony_ci      "../common_type/include",
50506694b06Sopenharmony_ci      "//commonlibrary/c_utils/base/include",
50606694b06Sopenharmony_ci    ]
50706694b06Sopenharmony_ci  }
50806694b06Sopenharmony_ci
50906694b06Sopenharmony_ci  base_deps = [ "${plugins_path}/libs/icu:icu_android" ]
51006694b06Sopenharmony_ci
51106694b06Sopenharmony_ci  ohos_source_set("native_rdb") {
51206694b06Sopenharmony_ci    defines = [ "ANDROID_PLATFORM" ]
51306694b06Sopenharmony_ci
51406694b06Sopenharmony_ci    part_name = "relational_store"
51506694b06Sopenharmony_ci
51606694b06Sopenharmony_ci    sources = base_sources
51706694b06Sopenharmony_ci
51806694b06Sopenharmony_ci    configs = [ ":native_rdb_config" ]
51906694b06Sopenharmony_ci
52006694b06Sopenharmony_ci    deps = base_deps
52106694b06Sopenharmony_ci
52206694b06Sopenharmony_ci    sources += [
52306694b06Sopenharmony_ci      "${relational_store_native_path}/rdb/mock/src/rdb_radar_reporter.cpp",
52406694b06Sopenharmony_ci      "${relational_store_native_path}/rdb/mock/src/task_executor.cpp",
52506694b06Sopenharmony_ci      "${relational_store_native_path}/rdb/src/security_policy.cpp",
52606694b06Sopenharmony_ci    ]
52706694b06Sopenharmony_ci    deps += [
52806694b06Sopenharmony_ci      "${relational_store_innerapi_path}/appdatafwk:relational_common_base",
52906694b06Sopenharmony_ci      "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog_android",
53006694b06Sopenharmony_ci      "//third_party/sqlite:sqlite_static",
53106694b06Sopenharmony_ci    ]
53206694b06Sopenharmony_ci    cflags_cc = [ "-std=c++17" ]
53306694b06Sopenharmony_ci
53406694b06Sopenharmony_ci    public_configs = [ ":native_rdb_public_config" ]
53506694b06Sopenharmony_ci    subsystem_name = "distributeddatamgr"
53606694b06Sopenharmony_ci  }
53706694b06Sopenharmony_ci} else if (is_ios) {
53806694b06Sopenharmony_ci  config("native_rdb_config") {
53906694b06Sopenharmony_ci    visibility = [ ":*" ]
54006694b06Sopenharmony_ci
54106694b06Sopenharmony_ci    include_dirs = [
54206694b06Sopenharmony_ci      "${relational_store_mock_path}/frameworks/native/rdb",
54306694b06Sopenharmony_ci      "${distributedfile_path}/mod_securitylabel",
54406694b06Sopenharmony_ci      "${relational_store_common_path}/include",
54506694b06Sopenharmony_ci      "${relational_store_innerapi_path}/rdb/mock/include",
54606694b06Sopenharmony_ci      "${relational_store_native_path}/rdb/mock/include",
54706694b06Sopenharmony_ci      "${relational_store_innerapi_path}/rdb/include",
54806694b06Sopenharmony_ci      "${relational_store_native_path}/rdb/include",
54906694b06Sopenharmony_ci      "${relational_store_native_path}/dfx/include",
55006694b06Sopenharmony_ci    ]
55106694b06Sopenharmony_ci
55206694b06Sopenharmony_ci    cflags = [ "-includemock.h" ]
55306694b06Sopenharmony_ci    defines = [
55406694b06Sopenharmony_ci      "RELATIONAL_STORE",
55506694b06Sopenharmony_ci      "SQLITE_HAS_CODEC",
55606694b06Sopenharmony_ci    ]
55706694b06Sopenharmony_ci
55806694b06Sopenharmony_ci    if (relational_store_rdb_support_icu) {
55906694b06Sopenharmony_ci      include_dirs += [
56006694b06Sopenharmony_ci        "//third_party/icu/icu4c/source",
56106694b06Sopenharmony_ci        "//third_party/icu/icu4c/source/i18n",
56206694b06Sopenharmony_ci        "//third_party/icu/icu4c/source/common",
56306694b06Sopenharmony_ci      ]
56406694b06Sopenharmony_ci      defines += [ "RDB_SUPPORT_ICU" ]
56506694b06Sopenharmony_ci    }
56606694b06Sopenharmony_ci  }
56706694b06Sopenharmony_ci
56806694b06Sopenharmony_ci  config("native_rdb_public_config") {
56906694b06Sopenharmony_ci    visibility = [ ":*" ]
57006694b06Sopenharmony_ci
57106694b06Sopenharmony_ci    include_dirs = [
57206694b06Sopenharmony_ci      "mock/include",
57306694b06Sopenharmony_ci      "include",
57406694b06Sopenharmony_ci      "${relational_store_native_path}/rdb/include",
57506694b06Sopenharmony_ci      "${relational_store_native_path}/dfx/include",
57606694b06Sopenharmony_ci      "../cloud_data/include",
57706694b06Sopenharmony_ci      "../common_type/include",
57806694b06Sopenharmony_ci      "//commonlibrary/c_utils/base/include",
57906694b06Sopenharmony_ci    ]
58006694b06Sopenharmony_ci  }
58106694b06Sopenharmony_ci
58206694b06Sopenharmony_ci  base_deps = [ "${plugins_path}/libs/icu:icu_ios" ]
58306694b06Sopenharmony_ci
58406694b06Sopenharmony_ci  ohos_source_set("native_rdb") {
58506694b06Sopenharmony_ci    defines = [
58606694b06Sopenharmony_ci      "IOS_PLATFORM",
58706694b06Sopenharmony_ci      "CROSS_PLATFORM",
58806694b06Sopenharmony_ci    ]
58906694b06Sopenharmony_ci
59006694b06Sopenharmony_ci    part_name = "relational_store"
59106694b06Sopenharmony_ci    sources = base_sources
59206694b06Sopenharmony_ci
59306694b06Sopenharmony_ci    configs = [ ":native_rdb_config" ]
59406694b06Sopenharmony_ci
59506694b06Sopenharmony_ci    deps = base_deps
59606694b06Sopenharmony_ci
59706694b06Sopenharmony_ci    sources += [
59806694b06Sopenharmony_ci      "${relational_store_native_path}/rdb/mock/src/rdb_radar_reporter.cpp",
59906694b06Sopenharmony_ci      "${relational_store_native_path}/rdb/mock/src/task_executor.cpp",
60006694b06Sopenharmony_ci      "${relational_store_native_path}/rdb/src/security_policy.cpp",
60106694b06Sopenharmony_ci    ]
60206694b06Sopenharmony_ci    deps += [
60306694b06Sopenharmony_ci      "${relational_store_innerapi_path}/appdatafwk:relational_common_base",
60406694b06Sopenharmony_ci      "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog_ios",
60506694b06Sopenharmony_ci      "//third_party/sqlite:sqlite_static",
60606694b06Sopenharmony_ci    ]
60706694b06Sopenharmony_ci
60806694b06Sopenharmony_ci    external_deps = [ "c_utils:utils" ]
60906694b06Sopenharmony_ci
61006694b06Sopenharmony_ci    cflags_cc = [ "-std=c++17" ]
61106694b06Sopenharmony_ci
61206694b06Sopenharmony_ci    public_configs = [ ":native_rdb_public_config" ]
61306694b06Sopenharmony_ci    subsystem_name = "distributeddatamgr"
61406694b06Sopenharmony_ci  }
61506694b06Sopenharmony_ci} else {
61606694b06Sopenharmony_ci  not_needed([ "base_sources" ])
61706694b06Sopenharmony_ci}
618