From f272648e3b57474154594e6991a74b6fdbcc03a2 Mon Sep 17 00:00:00 2001 From: wwx1088189 Date: Mon, 24 Apr 2023 10:23:48 +0800 Subject: [PATCH] delete components Signed-off-by: wwx1088189 --- config/component/cJSON/BUILD.gn | 59 --------- config/component/lite_component.gni | 194 ---------------------------- config/component/openssl/BUILD.gn | 49 ------- config/component/zlib/BUILD.gn | 74 ----------- 4 files changed, 376 deletions(-) delete mode 100755 config/component/cJSON/BUILD.gn delete mode 100644 config/component/lite_component.gni delete mode 100755 config/component/openssl/BUILD.gn delete mode 100755 config/component/zlib/BUILD.gn diff --git a/config/component/cJSON/BUILD.gn b/config/component/cJSON/BUILD.gn deleted file mode 100755 index dfab4fc..0000000 --- a/config/component/cJSON/BUILD.gn +++ /dev/null @@ -1,59 +0,0 @@ -# -# 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. -# - -import("//build/lite/config/component/lite_component.gni") -import("//build/lite/ndk/ndk.gni") - -config("cjson_config") { - include_dirs = [ "//third_party/cJSON" ] - ldflags = [ "-lm" ] - defines = [ "CJSON_NESTING_LIMIT=(128)" ] - if (board_toolchain_type == "iccarm") { - cflags = [ - "--diag_suppress", - "Pa084", - ] - } -} - -cjson_sources = [ - "//third_party/cJSON/cJSON.c", - "//third_party/cJSON/cJSON_Utils.c", -] - -lite_library("cjson_static") { - target_type = "static_library" - sources = cjson_sources - public_configs = [ ":cjson_config" ] -} - -lite_library("cjson_shared") { - target_type = "shared_library" - sources = cjson_sources - public_configs = [ ":cjson_config" ] -} - -ndk_lib("cjson_ndk") { - if (board_name != "hispark_pegasus") { - lib_extension = ".so" - deps = [ ":cjson_shared" ] - } else { - deps = [ ":cjson_static" ] - } - head_files = [ - "//third_party/cJSON/cJSON.h", - "//third_party/cJSON/cJSON_Utils.h", - ] -} diff --git a/config/component/lite_component.gni b/config/component/lite_component.gni deleted file mode 100644 index ee32141..0000000 --- a/config/component/lite_component.gni +++ /dev/null @@ -1,194 +0,0 @@ -# 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. - -import("//build/lite/config/subsystem/aafwk/path.gni") - -template("lite_library") { - assert(defined(invoker.target_type), "Library target_type is required.") - assert(defined(invoker.sources), "Library sources is required.") - target_type = invoker.target_type - shared_lib = target_type == "shared_library" - - if (shared_lib && - (ohos_kernel_type == "liteos_m" || ohos_kernel_type == "uniproton")) { - group(target_name) { - if (defined(invoker.sources)) { - assert(invoker.sources != "") - } - if (defined(invoker.public_configs)) { - assert(invoker.public_configs != "") - } - if (defined(invoker.public_deps)) { - assert(invoker.public_deps != "") - } - if (defined(invoker.output_name)) { - assert(invoker.output_name != "") - } - } - } else { - target(target_type, target_name) { - forward_variables_from(invoker, "*", [ "remove_configs" ]) - cflags = [] - cflags_cc = [] - ldflags = [] - if (defined(invoker.cflags)) { - cflags += invoker.cflags - } - if (defined(invoker.cflags_cc)) { - cflags_cc += invoker.cflags_cc - ldflags += [ "-lstdc++" ] - } - if (defined(invoker.ldflags)) { - ldflags += invoker.ldflags - } - if (defined(invoker.remove_configs)) { - configs -= invoker.remove_configs - } - shared_lib = target_type == "shared_library" - if (shared_lib) { - cflags += [ "-fPIC" ] - cflags_cc += [ "-fPIC" ] - } else if (!shared_lib && (ohos_kernel_type != "liteos_m" && - ohos_kernel_type != "uniproton")) { - cflags += [ "-fPIE" ] - cflags_cc += [ "-fPIE" ] - } - } - } -} - -# Defines a component -# -# The lite_component template defines all the modules contained in a subsystem -# -# Parameters -# -# features (required) -# [list of scopes] Defines all features in the component. -template("lite_component") { - assert(defined(invoker.features), "Component features is required.") - - if (!defined(invoker.target_type)) { - target_type = "group" - } else if (invoker.target_type == "static_library") { - target_type = "group" - } else { - target_type = invoker.target_type - } - assert(target_type != "") - - target(target_type, target_name) { - deps = [] - - forward_variables_from(invoker, "*") - - # add component deps - if (defined(invoker.deps)) { - deps += invoker.deps - } - - # add component features - foreach(feature_label, features) { - deps += [ feature_label ] - } - } -} - -template("build_ext_component") { - forward_variables_from(invoker, [ "testonly" ]) - if (defined(invoker.version)) { - print(invoker.version) - } - action(target_name) { - forward_variables_from(invoker, - [ - "no_default_deps", - "deps", - ]) - args = [] - if (defined(invoker.exec_path)) { - args += [ "--path=${invoker.exec_path}" ] - } - if (defined(invoker.enable)) { - args += [ "--enable=${invoker.enable}" ] - } - if (defined(invoker.prebuilts)) { - args += [ "--prebuilts=${invoker.prebuilts}" ] - } - if (defined(invoker.command)) { - args += [ "--command=${invoker.command}" ] - } - - # external component build log - target_dir = rebase_path("${target_out_dir}/build.log") - args += [ "--target_dir=${target_dir}" ] - - # external component error log if compile failed - out_dir = rebase_path("${root_out_dir}/error.log") - args += [ "--out_dir=${out_dir}" ] - script = "//build/lite/build_ext_components.py" - outputs = [ "$target_out_dir/${target_name}_build_ext_components.txt" ] - if (defined(invoker.outputs)) { - outputs += invoker.outputs - } - } -} - -template("ohos_tools") { - target(invoker.target_type, target_name) { - forward_variables_from(invoker, "*") - output_dir = "$root_out_dir/tools/$target_name" - if (ohos_kernel_type == "liteos_a" || ohos_kernel_type == "linux") { - configs -= [ "//build/lite/config:ohos" ] - } else if (ohos_kernel_type == "liteos_m") { - configs -= [ "//build/lite/config:liteos" ] - } - configs -= [ "//build/lite/config:pie_executable_config" ] - configs -= [ "//build/lite/config:static_pie_config" ] - configs += [ "//build/lite/config:tools" ] - } -} - -template("generate_notice_file") { - assert(defined(invoker.module_name), "module_name in required.") - assert(defined(invoker.module_source_dir_list), - "module_source_dir_list in required.") - assert(target_name != "") - forward_variables_from(invoker, - [ - "module_name", - "module_source_dir_list", - ]) - gen_script = rebase_path("//build/lite/gen_module_notice_file.py") - - foreach(module_source_dir, module_source_dir_list) { - arguments = [] - arguments = [ - "--root-out-dir", - rebase_path(root_out_dir), - "--module-source-dir", - rebase_path(module_source_dir), - "--module-relative-source-dir", - rebase_path(module_source_dir, "//"), - "--target-name", - module_name, - ] - ret_msg = "" - ret_msg = exec_script(gen_script, arguments, "list lines") - if (ret_msg != "") { - foreach(msg, ret_msg) { - print(msg) - } - } - } -} diff --git a/config/component/openssl/BUILD.gn b/config/component/openssl/BUILD.gn deleted file mode 100755 index ecba772..0000000 --- a/config/component/openssl/BUILD.gn +++ /dev/null @@ -1,49 +0,0 @@ -# -# 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. -# - -import("//build/lite/config/component/lite_component.gni") - -config("openssl_config") { - include_dirs = [ - "//third_party/openssl/include", - "//third_party/openssl/crypto/include", - "//third_party/openssl/crypto/ec", - "//third_party/openssl", - ] - - cflags = [ - "-fPIC", - "-DOPENSSL_ARM_PLATFORM", - ] -} - -openssl_source = [ - "//third_party/openssl/crypto/cryptlib.c", - "//third_party/openssl/crypto/ec/curve25519.c", - "//third_party/openssl/crypto/mem_clr.c", - "//third_party/openssl/crypto/sha/sha512.c", -] - -lite_library("openssl_shared") { - target_type = "shared_library" - sources = openssl_source - public_configs = [ ":openssl_config" ] -} - -lite_library("openssl_static") { - target_type = "static_library" - sources = openssl_source - public_configs = [ ":openssl_config" ] -} diff --git a/config/component/zlib/BUILD.gn b/config/component/zlib/BUILD.gn deleted file mode 100755 index c1362e1..0000000 --- a/config/component/zlib/BUILD.gn +++ /dev/null @@ -1,74 +0,0 @@ -# -# 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. -# - -import("//build/lite/config/component/lite_component.gni") - -config("zlib_config") { - include_dirs = [ "//third_party/zlib" ] -} - -zlib_source = [ - "//third_party/zlib/adler32.c", - "//third_party/zlib/compress.c", - "//third_party/zlib/crc32.c", - "//third_party/zlib/crc32.h", - "//third_party/zlib/deflate.c", - "//third_party/zlib/deflate.h", - "//third_party/zlib/gzclose.c", - "//third_party/zlib/gzguts.h", - "//third_party/zlib/gzlib.c", - "//third_party/zlib/gzread.c", - "//third_party/zlib/gzwrite.c", - "//third_party/zlib/infback.c", - "//third_party/zlib/inffast.c", - "//third_party/zlib/inffast.h", - "//third_party/zlib/inffixed.h", - "//third_party/zlib/inflate.h", - "//third_party/zlib/inflate.c", - "//third_party/zlib/inftrees.c", - "//third_party/zlib/inftrees.h", - "//third_party/zlib/trees.c", - "//third_party/zlib/trees.h", - "//third_party/zlib/uncompr.c", - "//third_party/zlib/zconf.h", - "//third_party/zlib/zlib.h", - "//third_party/zlib/zutil.c", - "//third_party/zlib/zutil.h", - "//third_party/zlib/contrib/minizip/ioapi.c", - "//third_party/zlib/contrib/minizip/unzip.c", - "//third_party/zlib/contrib/minizip/zip.c", -] - -lite_library("zlib_shared") { - target_type = "shared_library" - sources = zlib_source - - public_configs = [ ":zlib_config" ] -} - -lite_library("zlib_static") { - target_type = "static_library" - sources = zlib_source - - public_configs = [ ":zlib_config" ] - - if (board_toolchain_type == "iccarm") { - cflags = [ - "--diag_suppress", - "Pe111,Pe147,Pe223", - ] - defines = [ "IOAPI_NO_64" ] - } -} -- Gitee