From 09105188ce8509145c0b49af35f5d3f2e7011267 Mon Sep 17 00:00:00 2001 From: yangjian Date: Wed, 8 Dec 2021 16:59:05 +0800 Subject: [PATCH] feat: posix kvstore by enable_ohos_utils_native_lite_kv_store_use_posix_kv_api Signed-off-by: yangjian Change-Id: Ib9dee5c0a8a1098457bee962957c2ae7c469f2a5 --- kv_store/src/BUILD.gn | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/kv_store/src/BUILD.gn b/kv_store/src/BUILD.gn index c2ce943..24befc9 100755 --- a/kv_store/src/BUILD.gn +++ b/kv_store/src/BUILD.gn @@ -9,17 +9,24 @@ # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and -# limitations under the License. +# limitations under the License. + +declare_args() { + enable_ohos_utils_native_lite_kv_store_use_posix_kv_api = true +} if (ohos_kernel_type == "liteos_m") { static_library("utils_kv_store") { - sources = [ - "kvstore_common/kvstore_common.c", - "kvstore_impl_hal/kv_store.c", - ] + sources = [ "kvstore_common/kvstore_common.c" ] + if (enable_ohos_utils_native_lite_kv_store_use_posix_kv_api) { + sources += [ "kvstore_impl_posix/kv_store.c" ] + } else { + sources += [ "kvstore_impl_hal/kv_store.c" ] + } include_dirs = [ "//utils/native/lite/include", "kvstore_common", + "//utils/native/lite/kv_store/innerkits", ] } } else { -- GitLab