From b45c389cf70916a569a20d5f5f004df1e5c3ca52 Mon Sep 17 00:00:00 2001 From: yudechen Date: Sat, 27 May 2023 11:33:40 +0800 Subject: [PATCH] remove example of extern syscap feature. Signed-off-by: yudechen Change-Id: I054ca7a5cf5d32ef8c186549c7146272725c362e --- BUILD.gn | 43 ++++++++------ config.gni | 3 +- include/codec_config/syscap_define.h | 2 +- include/codec_config/syscap_define_extern.h | 65 --------------------- 4 files changed, 26 insertions(+), 87 deletions(-) delete mode 100644 include/codec_config/syscap_define_extern.h diff --git a/BUILD.gn b/BUILD.gn index 0dbe6ed..206f20a 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -31,8 +31,9 @@ sources_platform_common = [ ] ohos_executable("syscap_tool_bin") { + deps = [] if (syscap_codec_config_extern_path != "") { - deps = [ ":gen_syscap_define_custom" ] + deps += [ ":gen_syscap_define_custom" ] inputs = [ "${root_build_dir}/syscap_define_custom.h" ] } output_name = "syscap_tool" @@ -73,8 +74,9 @@ if (defined(ohos_lite)) { } } else { shared_library("syscap_interface_shared") { + deps = [] if (syscap_codec_config_extern_path != "") { - deps = [ ":gen_syscap_define_custom" ] + deps += [ ":gen_syscap_define_custom" ] inputs = [ "${root_build_dir}/syscap_define_custom.h" ] } _version_script = rebase_path("libsyscap_interface_shared.versionscript") @@ -103,8 +105,9 @@ if (defined(ohos_lite)) { } } else { ohos_shared_library("syscap_interface_shared") { + deps = [] if (syscap_codec_config_extern_path != "") { - deps = [ ":gen_syscap_define_custom" ] + deps += [ ":gen_syscap_define_custom" ] inputs = [ "${root_build_dir}/syscap_define_custom.h" ] } version_script = "libsyscap_interface_shared.versionscript" @@ -155,22 +158,24 @@ ohos_prebuilt_etc("PCID.sc") { part_name = "syscap_codec" } -# generate syscap_define_custom.h -action("gen_syscap_define_custom") { - script = "./tools/syscap_config_merge.py" - args = [ - "--base", - rebase_path("include/codec_config/syscap_define.h"), - "--extern", - rebase_path(syscap_codec_config_extern_path), - "--output", - rebase_path("${root_build_dir}/syscap_define_custom.h"), - ] - inputs = [ - "include/codec_config/syscap_define.h", - syscap_codec_config_extern_path, - ] - outputs = [ "${root_build_dir}/syscap_define_custom.h" ] +if (syscap_codec_config_extern_path != "") { + # generate syscap_define_custom.h + action("gen_syscap_define_custom") { + script = "./tools/syscap_config_merge.py" + args = [ + "--base", + rebase_path("include/codec_config/syscap_define.h"), + "--extern", + rebase_path(syscap_codec_config_extern_path), + "--output", + rebase_path("${root_build_dir}/syscap_define_custom.h"), + ] + inputs = [ + "include/codec_config/syscap_define.h", + syscap_codec_config_extern_path, + ] + outputs = [ "${root_build_dir}/syscap_define_custom.h" ] + } } group("pcid_sc") { diff --git a/config.gni b/config.gni index 198febf..a698cd4 100644 --- a/config.gni +++ b/config.gni @@ -15,6 +15,5 @@ declare_args() { syscap_codec_config_path = # customization for head file syscap_define.h. "//developtools/syscap_codec/include/codec_config" - syscap_codec_config_extern_path = - "include/codec_config/syscap_define_extern.h" + syscap_codec_config_extern_path = "" } diff --git a/include/codec_config/syscap_define.h b/include/codec_config/syscap_define.h index cc2c438..de0b19f 100644 --- a/include/codec_config/syscap_define.h +++ b/include/codec_config/syscap_define.h @@ -285,7 +285,7 @@ typedef enum SystemCapabilityNum { WINDOW_WINDOW_MANAGER_LITE, DRIVER_DEVICEMANAGER_EXTENSION, // Add before here - SYSCAP_NUM_MAX = 500 + SYSCAP_BASIC_END = 500 } SyscapNum; diff --git a/include/codec_config/syscap_define_extern.h b/include/codec_config/syscap_define_extern.h deleted file mode 100644 index 63e164d..0000000 --- a/include/codec_config/syscap_define_extern.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2021-2022 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. - */ - -#ifndef SYSCAP_DEFINE_EXTERN_H -#define SYSCAP_DEFINE_EXTERN_H - -#include - -#ifdef __cplusplus -#if __cplusplus -extern "C" { -#endif /* __cplusplus */ -#endif /* __cplusplus */ - -#ifndef SYSCAP_DEFINE_H -#define SINGLE_SYSCAP_LEN (256 + 17) - -typedef struct SystemCapabilityWithNum { - char str[SINGLE_SYSCAP_LEN]; - uint16_t num; -} SyscapWithNum; - -#endif - -/* - * New SyscapNum must be added last and - * don't delete anyone, just comment after it. - */ -typedef enum SystemCapabilityNumExtern { - SYSCAP_EXTERN_BEGIN = 500, - ENUM_SYSCAP_AAA, - ENUM_SYSCAP_BBB, - ENUM_SYSCAP_CCC, - // Add before here - SYSCAP_EXTERN_NUM_MAX = 960 -} SyscapNumExtern; - - -/* Sort by SyscapNum */ -const static SyscapWithNum g_arraySyscapExtern[] = { - {"SystemCapability.AAA.AAAA", ENUM_SYSCAP_AAA}, - {"SystemCapability.BBB.BBBB", ENUM_SYSCAP_BBB}, - {"SystemCapability.CCC.CCCC", ENUM_SYSCAP_CCC}, -}; - -uint32_t g_arraySyscapExternNum = sizeof(g_arraySyscapExtern) / sizeof(SyscapWithNum); - -#ifdef __cplusplus -#if __cplusplus -} -#endif /* __cplusplus */ -#endif /* __cplusplus */ -#endif // SYSCAP_DEFINE_EXTERN_H