1# Copyright (C) 2023 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. 13 14import("//build/config/ohos/config.gni") 15import("//build/ohos.gni") 16import("//foundation/arkui/napi/napi.gni") 17import("//foundation/distributeddatamgr/relational_store/relational_store.gni") 18 19relational_store_ndk_path = "${relational_store_base_path}/interfaces" 20 21config("config") { 22 visibility = [ ":*" ] 23 24 cflags = [ 25 "-Wall", 26 "-Werror", 27 "-g3", 28 "-Wunused-variable", 29 ] 30} 31 32## backup ############################################################### 33ohos_shared_library("backup") { 34 subsystem_name = "distributeddatamgr" 35 part_name = "relational_store" 36 sources = [ "./napi/rdb_store_backup_test.cpp" ] 37 38 include_dirs = [ 39 "../cpp", 40 "../cpp/common", 41 "${relational_store_common_path}/include", 42 "${relational_store_native_path}/rdb/include", 43 "${relational_store_ndk_path}/ndk/include/", 44 "${relational_store_ndk_path}/ndk/src/", 45 "${relational_store_base_path}/interfaces/ndk/include/oh_cursor.h", 46 "${relational_store_base_path}/interfaces/ndk/include/oh_predicates.h", 47 "${relational_store_base_path}/interfaces/ndk/include/oh_values_object.h", 48 "${relational_store_base_path}/interfaces/ndk/include/oh_values_bucket.h", 49 "${relational_store_base_path}/interfaces/ndk/include/relational_store.h", 50 "${relational_store_base_path}/interfaces/ndk/include/relational_store_error_code.h", 51 "${relational_store_base_path}/interfaces/ndk/src/relational_cursor.cpp", 52 "${relational_store_base_path}/interfaces/ndk/src/relational_predicates.cpp", 53 "${relational_store_base_path}/interfaces/ndk/src/relational_store.cpp", 54 "${relational_store_base_path}/interfaces/ndk/src/relational_value_object.cpp", 55 "${relational_store_base_path}/interfaces/ndk/src/relational_values_bucket.cpp", 56 "${relational_store_base_path}/interfaces/ndk/include", 57 ] 58 configs = [ ":config" ] 59 deps = [ "${relational_store_ndk_path}/ndk/src:native_rdb_ndk" ] 60 external_deps = [ "napi:ace_napi" ] 61 62 output_extension = "so" 63} 64 65## encrypt ############################################################### 66ohos_shared_library("encrypt") { 67 subsystem_name = "distributeddatamgr" 68 part_name = "relational_store" 69 sources = [ "./napi/rdb_store_encrypt_test.cpp" ] 70 71 include_dirs = [ 72 "../cpp", 73 "../cpp/common", 74 "${relational_store_common_path}/include", 75 "${relational_store_native_path}/rdb/include", 76 "${relational_store_ndk_path}/ndk/include/", 77 "${relational_store_ndk_path}/ndk/src/", 78 "${relational_store_base_path}/interfaces/ndk/include/oh_cursor.h", 79 "${relational_store_base_path}/interfaces/ndk/include/oh_predicates.h", 80 "${relational_store_base_path}/interfaces/ndk/include/oh_values_object.h", 81 "${relational_store_base_path}/interfaces/ndk/include/oh_values_bucket.h", 82 "${relational_store_base_path}/interfaces/ndk/include/relational_store.h", 83 "${relational_store_base_path}/interfaces/ndk/include/relational_store_error_code.h", 84 "${relational_store_base_path}/interfaces/ndk/src/relational_cursor.cpp", 85 "${relational_store_base_path}/interfaces/ndk/src/relational_predicates.cpp", 86 "${relational_store_base_path}/interfaces/ndk/src/relational_store.cpp", 87 "${relational_store_base_path}/interfaces/ndk/src/relational_value_object.cpp", 88 "${relational_store_base_path}/interfaces/ndk/src/relational_values_bucket.cpp", 89 "${relational_store_base_path}/interfaces/ndk/include", 90 ] 91 configs = [ ":config" ] 92 deps = [ "${relational_store_ndk_path}/ndk/src:native_rdb_ndk" ] 93 external_deps = [ "napi:ace_napi" ] 94 95 output_extension = "so" 96} 97 98## level ############################################################### 99ohos_shared_library("level") { 100 subsystem_name = "distributeddatamgr" 101 part_name = "relational_store" 102 sources = [ "./napi/rdb_store_level_test.cpp" ] 103 104 include_dirs = [ 105 "../cpp", 106 "../cpp/common", 107 "${relational_store_common_path}/include", 108 "${relational_store_native_path}/rdb/include", 109 "${relational_store_ndk_path}/ndk/include/", 110 "${relational_store_ndk_path}/ndk/src/", 111 "${relational_store_base_path}/interfaces/ndk/include/oh_cursor.h", 112 "${relational_store_base_path}/interfaces/ndk/include/oh_predicates.h", 113 "${relational_store_base_path}/interfaces/ndk/include/oh_values_object.h", 114 "${relational_store_base_path}/interfaces/ndk/include/oh_values_bucket.h", 115 "${relational_store_base_path}/interfaces/ndk/include/relational_store.h", 116 "${relational_store_base_path}/interfaces/ndk/include/relational_store_error_code.h", 117 "${relational_store_base_path}/interfaces/ndk/src/relational_cursor.cpp", 118 "${relational_store_base_path}/interfaces/ndk/src/relational_predicates.cpp", 119 "${relational_store_base_path}/interfaces/ndk/src/relational_store.cpp", 120 "${relational_store_base_path}/interfaces/ndk/src/relational_value_object.cpp", 121 "${relational_store_base_path}/interfaces/ndk/src/relational_values_bucket.cpp", 122 "${relational_store_base_path}/interfaces/ndk/include", 123 ] 124 configs = [ ":config" ] 125 deps = [ "${relational_store_ndk_path}/ndk/src:native_rdb_ndk" ] 126 external_deps = [ "napi:ace_napi" ] 127 128 output_extension = "so" 129} 130 131## cursor ############################################################### 132ohos_shared_library("cursor") { 133 subsystem_name = "distributeddatamgr" 134 part_name = "relational_store" 135 sources = [ "./napi/rdb_store_cursor_test.cpp" ] 136 137 include_dirs = [ 138 "../cpp", 139 "../cpp/common", 140 "${relational_store_common_path}/include", 141 "${relational_store_native_path}/rdb/include", 142 "${relational_store_ndk_path}/ndk/include/", 143 "${relational_store_ndk_path}/ndk/src/", 144 "${relational_store_base_path}/interfaces/ndk/include/oh_cursor.h", 145 "${relational_store_base_path}/interfaces/ndk/include/oh_predicates.h", 146 "${relational_store_base_path}/interfaces/ndk/include/oh_values_object.h", 147 "${relational_store_base_path}/interfaces/ndk/include/oh_values_bucket.h", 148 "${relational_store_base_path}/interfaces/ndk/include/relational_store.h", 149 "${relational_store_base_path}/interfaces/ndk/include/relational_store_error_code.h", 150 "${relational_store_base_path}/interfaces/ndk/src/relational_cursor.cpp", 151 "${relational_store_base_path}/interfaces/ndk/src/relational_predicates.cpp", 152 "${relational_store_base_path}/interfaces/ndk/src/relational_store.cpp", 153 "${relational_store_base_path}/interfaces/ndk/src/relational_value_object.cpp", 154 "${relational_store_base_path}/interfaces/ndk/src/relational_values_bucket.cpp", 155 "${relational_store_base_path}/interfaces/ndk/include", 156 ] 157 configs = [ ":config" ] 158 deps = [ "${relational_store_ndk_path}/ndk/src:native_rdb_ndk" ] 159 external_deps = [ "napi:ace_napi" ] 160 161 output_extension = "so" 162} 163 164## predicates ############################################################### 165ohos_shared_library("predicates") { 166 subsystem_name = "distributeddatamgr" 167 part_name = "relational_store" 168 sources = [ "./napi/rdb_store_predicates_test.cpp" ] 169 170 include_dirs = [ 171 "../cpp", 172 "../cpp/common", 173 "${relational_store_common_path}/include", 174 "${relational_store_native_path}/rdb/include", 175 "${relational_store_ndk_path}/ndk/include/", 176 "${relational_store_ndk_path}/ndk/src/", 177 "${relational_store_base_path}/interfaces/ndk/include/oh_cursor.h", 178 "${relational_store_base_path}/interfaces/ndk/include/oh_predicates.h", 179 "${relational_store_base_path}/interfaces/ndk/include/oh_values_object.h", 180 "${relational_store_base_path}/interfaces/ndk/include/oh_values_bucket.h", 181 "${relational_store_base_path}/interfaces/ndk/include/relational_store.h", 182 "${relational_store_base_path}/interfaces/ndk/include/relational_store_error_code.h", 183 "${relational_store_base_path}/interfaces/ndk/src/relational_cursor.cpp", 184 "${relational_store_base_path}/interfaces/ndk/src/relational_predicates.cpp", 185 "${relational_store_base_path}/interfaces/ndk/src/relational_store.cpp", 186 "${relational_store_base_path}/interfaces/ndk/src/relational_value_object.cpp", 187 "${relational_store_base_path}/interfaces/ndk/src/relational_values_bucket.cpp", 188 "${relational_store_base_path}/interfaces/ndk/include", 189 ] 190 configs = [ ":config" ] 191 deps = [ "${relational_store_ndk_path}/ndk/src:native_rdb_ndk" ] 192 external_deps = [ "napi:ace_napi" ] 193 194 output_extension = "so" 195} 196 197## rdbstore ############################################################### 198ohos_shared_library("rdbstore") { 199 subsystem_name = "distributeddatamgr" 200 part_name = "relational_store" 201 sources = [ "./napi/rdb_store_test.cpp" ] 202 203 include_dirs = [ 204 "../cpp", 205 "../cpp/common", 206 "${relational_store_common_path}/include", 207 "${relational_store_native_path}/rdb/include", 208 "${relational_store_ndk_path}/ndk/include/", 209 "${relational_store_ndk_path}/ndk/src/", 210 "${relational_store_base_path}/interfaces/ndk/include/oh_cursor.h", 211 "${relational_store_base_path}/interfaces/ndk/include/oh_predicates.h", 212 "${relational_store_base_path}/interfaces/ndk/include/oh_values_object.h", 213 "${relational_store_base_path}/interfaces/ndk/include/oh_values_bucket.h", 214 "${relational_store_base_path}/interfaces/ndk/include/relational_store.h", 215 "${relational_store_base_path}/interfaces/ndk/include/relational_store_error_code.h", 216 "${relational_store_base_path}/interfaces/ndk/src/relational_cursor.cpp", 217 "${relational_store_base_path}/interfaces/ndk/src/relational_predicates.cpp", 218 "${relational_store_base_path}/interfaces/ndk/src/relational_store.cpp", 219 "${relational_store_base_path}/interfaces/ndk/src/relational_value_object.cpp", 220 "${relational_store_base_path}/interfaces/ndk/src/relational_values_bucket.cpp", 221 "${relational_store_base_path}/interfaces/ndk/include", 222 ] 223 configs = [ ":config" ] 224 deps = [ "${relational_store_ndk_path}/ndk/src:native_rdb_ndk" ] 225 external_deps = [ "napi:ace_napi" ] 226 227 output_extension = "so" 228} 229