diff --git a/js/builtin/common/BUILD.gn b/js/builtin/common/BUILD.gn index dd8f39ab4682a4bbeb528351886cee872e9fda8c..699965e2f7d42d8f4b4077f35885a656af2ced34 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 19e76ea6a725db7a5d3d1e7a84b0df05918d3dfc..2103dce4fe8bb9293a6d7947e3cf163ef485f8ea 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 d61d9b19c0a813c4eb06f24ee1528b5323780323..9979cef06e5d7d1cc773242600a06c4b7174b214 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 ddea7a32384298fee56568bed9b34d79cfe8802c..65cae602abab4eb666f61ff80b2b2145fba28637 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 7b75e4c0f734930fe9f9fbf773139064067537cf..119ef4d36b35a597614de3a3896edf8d36ea7548 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 16e95aba1c4431f3c73edfb653f1a0a143a316e2..33584a79457a2c590f57e3a0c37200ddd3df63eb 100755 --- a/timer_task/BUILD.gn +++ b/timer_task/BUILD.gn @@ -1,30 +1,35 @@ -# 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("ace_kit_timer") { - sources = [ - "src/nativeapi_timer_task.c", - ] - cflags = ["-Wall"] - cflags_cc = cflags - - include_dirs = [ - "include", - "//utils/native/lite/include", - "//utils/native/lite/kal/timer/include", - ] - if (ohos_kernel_type == "liteos_a") { - include_dirs += ["//third_party/musl/include"] - } - public_deps = ["//utils/native/lite/kal/timer:kal_timer"] -} \ No newline at end of file + +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" ] + cflags = [ "-Wall" ] + cflags_cc = cflags + + include_dirs = [ + "include", + "//utils/native/lite/include", + "//utils/native/lite/kal/timer/include", + ] + if (ohos_kernel_type == "liteos_a") { + include_dirs += [ "//third_party/musl/include" ] + } + public_deps = [ "//utils/native/lite/kal/timer:kal_timer" ] +}