From 3bd7b46e84792d1c8e28069d5222e0acb35e38de Mon Sep 17 00:00:00 2001 From: dudonghai Date: Wed, 17 Nov 2021 18:26:52 +0800 Subject: [PATCH] feat: adapt m-core bes Signed-off-by: dudonghai Change-Id: Iaa69e7a77893dbec52fd09cbaf9e0065995da633 --- js/builtin/common/BUILD.gn | 9 +++++- js/builtin/deviceinfokit/BUILD.gn | 10 ++++-- js/builtin/filekit/BUILD.gn | 8 ++++- js/builtin/kvstorekit/BUILD.gn | 8 ++++- kal/timer/BUILD.gn | 53 +++++++++++++++++-------------- timer_task/BUILD.gn | 9 +++++- 6 files changed, 67 insertions(+), 30 deletions(-) diff --git a/js/builtin/common/BUILD.gn b/js/builtin/common/BUILD.gn index dd8f39a..699965e 100755 --- a/js/builtin/common/BUILD.gn +++ b/js/builtin/common/BUILD.gn @@ -13,7 +13,14 @@ # limitations under the License. # -shared_library("ace_kit_common") { +import("//build/lite/config/component/lite_component.gni") + +lite_library("ace_kit_common") { + if (ohos_kernel_type == "liteos_m") { + target_type = "static_library" + } else { + target_type = "shared_library" + } sources = [ "src/nativeapi_common.cpp" ] cflags = [ "-Wall" ] cflags_cc = cflags diff --git a/js/builtin/deviceinfokit/BUILD.gn b/js/builtin/deviceinfokit/BUILD.gn index 19e76ea..2103dce 100755 --- a/js/builtin/deviceinfokit/BUILD.gn +++ b/js/builtin/deviceinfokit/BUILD.gn @@ -13,11 +13,17 @@ # limitations under the License. # -shared_library("ace_kit_deviceinfo") { +import("//build/lite/config/component/lite_component.gni") + +lite_library("ace_kit_deviceinfo") { + if (ohos_kernel_type == "liteos_m") { + target_type = "static_library" + } else { + target_type = "shared_library" + } sources = [ "src/nativeapi_deviceinfo.cpp" ] cflags = [ "-Wall" ] cflags_cc = cflags - ldflags = [ "-shared" ] include_dirs = [ "include", diff --git a/js/builtin/filekit/BUILD.gn b/js/builtin/filekit/BUILD.gn index d61d9b1..9979cef 100755 --- a/js/builtin/filekit/BUILD.gn +++ b/js/builtin/filekit/BUILD.gn @@ -13,9 +13,15 @@ # limitations under the License. # +import("//build/lite/config/component/lite_component.gni") import("//build/lite/config/subsystem/aafwk/path.gni") -shared_library("ace_kit_file") { +lite_library("ace_kit_file") { + if (ohos_kernel_type == "liteos_m") { + target_type = "static_library" + } else { + target_type = "shared_library" + } sources = [ "src/nativeapi_fs.cpp", "src/nativeapi_fs_impl.c", diff --git a/js/builtin/kvstorekit/BUILD.gn b/js/builtin/kvstorekit/BUILD.gn index ddea7a3..65cae60 100755 --- a/js/builtin/kvstorekit/BUILD.gn +++ b/js/builtin/kvstorekit/BUILD.gn @@ -13,9 +13,15 @@ # limitations under the License. # +import("//build/lite/config/component/lite_component.gni") import("//build/lite/config/subsystem/aafwk/path.gni") -shared_library("ace_kit_kvstore") { +lite_library("ace_kit_kvstore") { + if (ohos_kernel_type == "liteos_m") { + target_type = "static_library" + } else { + target_type = "shared_library" + } sources = [ "src/nativeapi_kv.cpp", "src/nativeapi_kv_impl.c", diff --git a/kal/timer/BUILD.gn b/kal/timer/BUILD.gn index 7b75e4c..119ef4d 100755 --- a/kal/timer/BUILD.gn +++ b/kal/timer/BUILD.gn @@ -1,25 +1,30 @@ -# Copyright (c) 2020 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# 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 +# Copyright (c) 2020 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# 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. - -shared_library("kal_timer") { - sources = [ - "src/kal.c", - ] - cflags = ["-Wall"] - cflags_cc = cflags - - include_dirs = [ - "include", - "//utils/native/lite/include", - ] -} \ No newline at end of file + +import("//build/lite/config/component/lite_component.gni") + +lite_library("kal_timer") { + if (ohos_kernel_type == "liteos_m") { + target_type = "static_library" + } else { + target_type = "shared_library" + } + sources = [ "src/kal.c" ] + cflags = [ "-Wall" ] + cflags_cc = cflags + + include_dirs = [ + "include", + "//utils/native/lite/include", + ] +} diff --git a/timer_task/BUILD.gn b/timer_task/BUILD.gn index 16e95ab..b0bed03 100755 --- a/timer_task/BUILD.gn +++ b/timer_task/BUILD.gn @@ -11,7 +11,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -shared_library("ace_kit_timer") { +import("//build/lite/config/component/lite_component.gni") + +lite_library("ace_kit_timer") { + if (ohos_kernel_type == "liteos_m") { + target_type = "static_library" + } else { + target_type = "shared_library" + } sources = [ "src/nativeapi_timer_task.c", ] -- Gitee