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("rdb") { 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 "src/napi_values_bucket.cpp", 36 ] 37 38 if (is_mingw || is_mac) { 39 include_dirs = [ 40 "mock/include", 41 "${relational_store_js_common_path}/mock/include", 42 "${relational_store_napi_path}/rdb/mock/include", 43 "//commonlibrary/c_utils/base/include", 44 "include", 45 "${relational_store_js_common_path}/include", 46 ] 47 cflags_cc = [ 48 "-std=c++17", 49 "-stdlib=libc++", 50 ] 51 if (is_mac) { 52 buildos = "mac" 53 defines = [ "MAC_PLATFORM" ] 54 } else { 55 buildos = "windows" 56 defines = [ "WINDOWS_PLATFORM" ] 57 } 58 sources += [ 59 "${relational_store_js_common_path}/mock/src/js_ability.cpp", 60 "${relational_store_js_common_path}/mock/src/js_utils.cpp", 61 ] 62 deps = [ 63 "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog_${buildos}", 64 "//foundation/arkui/napi:ace_napi", 65 "//foundation/distributeddatamgr/relational_store/interfaces/inner_api/rdb:native_rdb", 66 ] 67 } else { 68 include_dirs = [ 69 "include", 70 "${relational_store_js_common_path}/include", 71 "${relational_store_napi_path}/rdb/include", 72 "${datashare_base_path}/interfaces/inner_api/common/include/", 73 ] 74 defines = [ "SQLITE_DISTRIBUTE_RELATIONAL" ] 75 sources += [ 76 "${relational_store_js_common_path}/src/js_ability.cpp", 77 "${relational_store_js_common_path}/src/js_utils.cpp", 78 "src/napi_rdb_store_observer.cpp", 79 ] 80 81 external_deps = [ 82 "ability_runtime:abilitykit_native", 83 "ability_runtime:napi_base_context", 84 "c_utils:utils", 85 "hilog_native:libhilog", 86 "hitrace_native:hitrace_meter", 87 "napi:ace_napi", 88 "relational_store:native_appdatafwk", 89 "relational_store:native_rdb", 90 "relational_store:rdb_data_share_adapter", 91 ] 92 } 93 94 subsystem_name = "distributeddatamgr" 95 part_name = "relational_store" 96 relative_install_dir = "module/data" 97} 98