From d940ddb0a6906aeac1fea34948d75f6ea09ec2b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=E4=B8=B6H?= Date: Mon, 18 Mar 2024 07:26:35 +0000 Subject: [PATCH] =?UTF-8?q?Revert=20"!2086=20=E9=83=A8=E4=BB=B6=E4=BE=9D?= =?UTF-8?q?=E8=B5=96=E6=95=B4=E6=94=B9"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 58b9efe98d8579d3bedf5b12832cd1a15c7aed96. --- adapter/khdf/liteos_m/osal/BUILD.gn | 5 +-- adapter/khdf/uniproton/osal/BUILD.gn | 5 +-- adapter/uhdf/hdi_small.gni | 5 +-- adapter/uhdf/manager/BUILD.gn | 9 +++--- adapter/uhdf/platform/BUILD.gn | 12 +++---- adapter/uhdf/posix/BUILD.gn | 9 +++--- adapter/uhdf/posix/old/BUILD.gn | 9 +++--- adapter/uhdf2/hdi.gni | 29 ++++++----------- adapter/uhdf2/hdi/BUILD.gn | 30 +++++++++-------- adapter/uhdf2/host/BUILD.gn | 26 +++++++-------- adapter/uhdf2/ipc/BUILD.gn | 22 +++++++------ adapter/uhdf2/manager/BUILD.gn | 14 ++++---- adapter/uhdf2/platform/BUILD.gn | 12 +++---- adapter/uhdf2/pub_utils/BUILD.gn | 10 +++--- adapter/uhdf2/security/BUILD.gn | 12 +++---- adapter/uhdf2/uhdf.gni | 32 ------------------- adapter/uhdf2/utils/BUILD.gn | 18 +++++------ framework/sample/platform/uart/dev/BUILD.gn | 4 +-- .../sample/platform/uart/dispatch/BUILD.gn | 4 +-- framework/tools/hdf_dbg/BUILD.gn | 8 ++--- 20 files changed, 106 insertions(+), 169 deletions(-) diff --git a/adapter/khdf/liteos_m/osal/BUILD.gn b/adapter/khdf/liteos_m/osal/BUILD.gn index bb2df822e..7a4e45487 100644 --- a/adapter/khdf/liteos_m/osal/BUILD.gn +++ b/adapter/khdf/liteos_m/osal/BUILD.gn @@ -27,7 +27,6 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -import("//drivers/hdf_core/adapter/uhdf2/uhdf.gni") import("./../hdf.gni") module_switch = defined(LOSCFG_DRIVERS_HDF) @@ -41,7 +40,5 @@ hdf_driver("hdf_osal_lite") { "src/osal_time.c", "src/osal_timer.c", ] - if (hilog_lite_enable) { - deps = [ "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_static" ] - } + deps = [ "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_static" ] } diff --git a/adapter/khdf/uniproton/osal/BUILD.gn b/adapter/khdf/uniproton/osal/BUILD.gn index fda62f9d7..7f17a63e0 100644 --- a/adapter/khdf/uniproton/osal/BUILD.gn +++ b/adapter/khdf/uniproton/osal/BUILD.gn @@ -26,7 +26,6 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -import("//drivers/hdf_core/adapter/uhdf2/uhdf.gni") import("./../hdf.gni") module_switch = defined(DRIVERS_HDF) @@ -40,7 +39,5 @@ hdf_driver("hdf_osal_lite") { "src/osal_time.c", "src/osal_timer.c", ] - if (hilog_lite_enable) { - deps = [ "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_static" ] - } + deps = [ "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_static" ] } diff --git a/adapter/uhdf/hdi_small.gni b/adapter/uhdf/hdi_small.gni index 6e0509b69..37640791a 100644 --- a/adapter/uhdf/hdi_small.gni +++ b/adapter/uhdf/hdi_small.gni @@ -13,7 +13,6 @@ import("//build/ohos.gni") import("//drivers/hdf_core/adapter/uhdf/uhdf.gni") -import("//drivers/hdf_core/adapter/uhdf2/uhdf.gni") template("hdi_small") { assert(defined(invoker.sources), "sources must be set") @@ -134,10 +133,8 @@ template("hdi_small") { external_deps = [ "bounds_checking_function:libsec_shared", "hdf_core:libhdi", + "hilog_lite:hilog_shared", ] - if (hilog_lite_enable) { - external_deps += [ "hilog_lite:hilog_shared" ] - } if (invoker.language == "c") { external_deps += [ "hdf_core:libhdf_utils" ] diff --git a/adapter/uhdf/manager/BUILD.gn b/adapter/uhdf/manager/BUILD.gn index 4d2a8f728..c3d139284 100644 --- a/adapter/uhdf/manager/BUILD.gn +++ b/adapter/uhdf/manager/BUILD.gn @@ -12,7 +12,6 @@ # limitations under the License. import("//build/ohos.gni") -import("//drivers/hdf_core/adapter/uhdf2/uhdf.gni") inner_api_relative_path = "./../../../interfaces/inner_api" @@ -53,10 +52,10 @@ ohos_shared_library("hdf_core") { "$hdf_frameworks_path/utils/src/hdf_sbuf_impl_raw.c", ] - deps = [ "//third_party/bounds_checking_function:libsec_shared" ] - if (hilog_lite_enable) { - deps += [ "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared" ] - } + deps = [ + "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", + "//third_party/bounds_checking_function:libsec_shared", + ] external_deps = [ "hdf_core:hdf_posix_osal" ] defines = [ "__USER__" ] diff --git a/adapter/uhdf/platform/BUILD.gn b/adapter/uhdf/platform/BUILD.gn index 5411acfc7..cee61d4c7 100644 --- a/adapter/uhdf/platform/BUILD.gn +++ b/adapter/uhdf/platform/BUILD.gn @@ -11,13 +11,12 @@ # See the License for the specific language governing permissions and # limitations under the License. +hdf_framework_path = "../../../framework" hdf_interfaces_path = "../../../interfaces" hdf_adapter_path = "../../../adapter" import("//build/ohos.gni") -import("./../../../adapter/uhdf2/uhdf.gni") config("hdf_platform_pub_config") { - hdf_framework_path = "../../../framework" visibility = [ ":*" ] include_dirs = [ @@ -49,7 +48,6 @@ config("hdf_platform_pub_config") { } ohos_shared_library("hdf_platform") { - hdf_framework_path = "../../../framework" include_dirs = [] public_configs = [ ":hdf_platform_pub_config" ] @@ -77,10 +75,10 @@ ohos_shared_library("hdf_platform") { deps = [ "//third_party/bounds_checking_function:libsec_shared" ] public_deps = [ "$hdf_adapter_path/uhdf/manager:hdf_core" ] - external_deps = [ "hdf_core:hdf_posix_osal" ] - if (hilog_lite_enable) { - external_deps += [ "hilog_lite:hilog_shared" ] - } + external_deps = [ + "hdf_core:hdf_posix_osal", + "hilog_lite:hilog_shared", + ] defines = [ "__USER__" ] diff --git a/adapter/uhdf/posix/BUILD.gn b/adapter/uhdf/posix/BUILD.gn index cd2028896..fd32d63e2 100644 --- a/adapter/uhdf/posix/BUILD.gn +++ b/adapter/uhdf/posix/BUILD.gn @@ -12,7 +12,6 @@ # limitations under the License. import("//build/ohos.gni") -import("//drivers/hdf_core/adapter/uhdf2/uhdf.gni") inner_api_relative_path = "./../../../interfaces/inner_api" @@ -41,10 +40,10 @@ if (defined(ohos_lite)) { "$framework_core_relative_path/osal_time.c", ] - deps = [ "//third_party/bounds_checking_function:libsec_shared" ] - if (hilog_lite_enable) { - deps += [ "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared" ] - } + deps = [ + "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", + "//third_party/bounds_checking_function:libsec_shared", + ] defines = [ "__USER__" ] ldflags = [ "-lpthread" ] diff --git a/adapter/uhdf/posix/old/BUILD.gn b/adapter/uhdf/posix/old/BUILD.gn index 48aab9936..ac2614108 100644 --- a/adapter/uhdf/posix/old/BUILD.gn +++ b/adapter/uhdf/posix/old/BUILD.gn @@ -12,16 +12,15 @@ # limitations under the License. import("//build/lite/config/component/lite_component.gni") -import("//drivers/hdf_core/adapter/uhdf2/uhdf.gni") shared_library("hdf_posix_osal") { hdf_framework_path = "./../../../../framework" hdf_core_path = "./../../../../../hdf_core" output_name = "hdf_osal" - deps = [ "//third_party/bounds_checking_function:libsec_shared" ] - if (hilog_lite_enable) { - deps += [ "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared" ] - } + deps = [ + "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", + "//third_party/bounds_checking_function:libsec_shared", + ] sources = [ "$hdf_framework_path/support/posix/src/osal_mem.c", "$hdf_framework_path/support/posix/src/osal_mutex.c", diff --git a/adapter/uhdf2/hdi.gni b/adapter/uhdf2/hdi.gni index d930d003d..ad825e20f 100644 --- a/adapter/uhdf2/hdi.gni +++ b/adapter/uhdf2/hdi.gni @@ -158,16 +158,11 @@ template("hdi") { public_deps += hdi_build_info.proxy_deps external_deps = [ + "c_utils:utils", "hdf_core:libhdi", "hdf_core:libpub_utils", + "hilog:libhilog", ] - - if (hilog_enable) { - external_deps += [ "hilog:libhilog" ] - } - if (c_utils_enable) { - external_deps += [ "c_utils:utils" ] - } if (defined(invoker.sequenceable_ext_deps)) { external_deps += invoker.sequenceable_ext_deps } @@ -177,9 +172,7 @@ template("hdi") { external_deps += [ "ipc:ipc_single" ] } } else { - if (hilog_enable) { - external_deps = [ "hilog:libhilog" ] - } + external_deps = [ "hilog:libhilog" ] } if (defined(invoker.innerapi_tags)) { @@ -226,13 +219,11 @@ template("hdi") { public_deps += hdi_build_info.stub_deps - external_deps = [ "hdf_core:libhdi" ] - if (hilog_enable) { - external_deps += [ "hilog:libhilog" ] - } - if (c_utils_enable) { - external_deps += [ "c_utils:utils" ] - } + external_deps = [ + "c_utils:utils", + "hdf_core:libhdi", + "hilog:libhilog", + ] if (defined(invoker.sequenceable_ext_deps)) { external_deps += invoker.sequenceable_ext_deps } @@ -245,9 +236,7 @@ template("hdi") { external_deps += [ "ipc:ipc_single" ] } } else { - if (hilog_enable) { - external_deps = [ "hilog:libhilog" ] - } + external_deps = [ "hilog:libhilog" ] } shlib_type = "hdi_stub" diff --git a/adapter/uhdf2/hdi/BUILD.gn b/adapter/uhdf2/hdi/BUILD.gn index d9ad278c8..555ec83ee 100644 --- a/adapter/uhdf2/hdi/BUILD.gn +++ b/adapter/uhdf2/hdi/BUILD.gn @@ -46,10 +46,10 @@ if (defined(ohos_lite)) { all_dependent_configs = [ ":libhdi_pub_config" ] sources = [ "src/hdi_support.cpp" ] - deps = [ "//third_party/bounds_checking_function:libsec_shared" ] - if (hilog_lite_enable) { - deps += [ "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared" ] - } + deps = [ + "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", + "//third_party/bounds_checking_function:libsec_shared", + ] defines = [ "__USER__" ] @@ -100,21 +100,23 @@ if (defined(ohos_lite)) { "src/stub_collector.cpp", ] - external_deps = [ "ipc:ipc_single" ] - if (samgr_enable) { - external_deps += [ "samgr:samgr_proxy" ] - } - if (hilog_enable) { - external_deps += [ "hilog:libhilog" ] - } if (is_standard_system) { deps = [ "../ipc:libhdf_ipc_adapter", "../pub_utils:libpub_utils", ] - if (c_utils_enable) { - external_deps += [ "c_utils:utils" ] - } + external_deps = [ + "c_utils:utils", + "hilog:libhilog", + "ipc:ipc_single", + "samgr:samgr_proxy", + ] + } else { + external_deps = [ + "hilog:libhilog", + "ipc:ipc_single", + "samgr:samgr_proxy", + ] } innerapi_tags = [ diff --git a/adapter/uhdf2/host/BUILD.gn b/adapter/uhdf2/host/BUILD.gn index a53d47a61..082140461 100644 --- a/adapter/uhdf2/host/BUILD.gn +++ b/adapter/uhdf2/host/BUILD.gn @@ -88,17 +88,17 @@ if (defined(ohos_lite)) { "$hdf_uhdf_path/shared/src/hcb_config_entry.c", ] - if (hilog_enable) { - external_deps = [ "hilog:libhilog" ] - } if (is_standard_system) { deps = [ "../ipc:libhdf_ipc_adapter", "../utils:libhdf_utils", ] - if (c_utils_enable) { - external_deps += [ "c_utils:utils" ] - } + external_deps = [ + "c_utils:utils", + "hilog:libhilog", + ] + } else { + external_deps = [ "hilog:libhilog" ] } install_images = [ chipset_base_dir ] @@ -122,19 +122,19 @@ if (defined(ohos_lite)) { sources = [ "devhost.c" ] - if (hilog_enable) { - external_deps = [ "hilog:libhilog" ] - } if (is_standard_system) { deps = [ "../host:libhdf_host", "../ipc:libhdf_ipc_adapter", "../utils:libhdf_utils", ] - external_deps += [ "init:libbegetutil" ] - if (c_utils_enable) { - external_deps += [ "c_utils:utils" ] - } + external_deps = [ + "c_utils:utils", + "hilog:libhilog", + "init:libbegetutil", + ] + } else { + external_deps = [ "hilog:libhilog" ] } # Ensure that the maximum page size is 4096 and the load section is aligned diff --git a/adapter/uhdf2/ipc/BUILD.gn b/adapter/uhdf2/ipc/BUILD.gn index caa77708f..302894090 100644 --- a/adapter/uhdf2/ipc/BUILD.gn +++ b/adapter/uhdf2/ipc/BUILD.gn @@ -46,18 +46,20 @@ if (defined(ohos_lite)) { "src/hdf_sbuf_impl_hipc.cpp", ] - external_deps = [ "ipc:ipc_single" ] - if (samgr_enable) { - external_deps += [ "samgr:samgr_proxy" ] - } - if (hilog_enable) { - external_deps += [ "hilog:libhilog" ] - } if (is_standard_system) { deps = [ "../pub_utils:libpub_utils" ] - if (c_utils_enable) { - external_deps += [ "c_utils:utils" ] - } + external_deps = [ + "c_utils:utils", + "hilog:libhilog", + "ipc:ipc_single", + "samgr:samgr_proxy", + ] + } else { + external_deps = [ + "hilog:libhilog", + "ipc:ipc_single", + "samgr:samgr_proxy", + ] } innerapi_tags = [ diff --git a/adapter/uhdf2/manager/BUILD.gn b/adapter/uhdf2/manager/BUILD.gn index 7bee26457..ad65b7d2d 100644 --- a/adapter/uhdf2/manager/BUILD.gn +++ b/adapter/uhdf2/manager/BUILD.gn @@ -76,15 +76,13 @@ ohos_executable("hdf_devmgr") { "../utils:libhdf_utils", ] - external_deps = [ "init:libbegetutil" ] - if (c_utils_enable) { - external_deps += [ "c_utils:utils" ] - } - if (hilog_enable) { - external_deps += [ "hilog:libhilog" ] - } + external_deps = [ + "c_utils:utils", + "hilog:libhilog", + "init:libbegetutil", + ] - if (build_selinux && selinux_adapter_enable) { + if (build_selinux) { external_deps += [ "selinux_adapter:libservice_checker" ] cflags = [ "-DWITH_SELINUX" ] } diff --git a/adapter/uhdf2/platform/BUILD.gn b/adapter/uhdf2/platform/BUILD.gn index 544fe07e2..ba8af2cad 100644 --- a/adapter/uhdf2/platform/BUILD.gn +++ b/adapter/uhdf2/platform/BUILD.gn @@ -56,15 +56,15 @@ if (is_standard_system) { defines = [ "__USER__" ] - if (hilog_enable) { - external_deps = [ "hilog:libhilog" ] - } if (is_standard_system) { deps = [ "../utils:libhdf_utils" ] - if (c_utils_enable) { - external_deps += [ "c_utils:utils" ] - } + external_deps = [ + "c_utils:utils", + "hilog:libhilog", + ] + } else { + external_deps = [ "hilog:libhilog" ] } cflags = [ diff --git a/adapter/uhdf2/pub_utils/BUILD.gn b/adapter/uhdf2/pub_utils/BUILD.gn index e59376973..c0b61f924 100644 --- a/adapter/uhdf2/pub_utils/BUILD.gn +++ b/adapter/uhdf2/pub_utils/BUILD.gn @@ -43,12 +43,10 @@ if (defined(ohos_lite)) { "$hdf_framework_path/utils/src/hdf_sbuf_impl_raw.c", ] - if (c_utils_enable) { - external_deps = [ "c_utils:utils" ] - } - if (hilog_enable) { - external_deps += [ "hilog:libhilog" ] - } + external_deps = [ + "c_utils:utils", + "hilog:libhilog", + ] install_images = [ system_base_dir, "updater", diff --git a/adapter/uhdf2/security/BUILD.gn b/adapter/uhdf2/security/BUILD.gn index a0846f00e..65ae4c5c0 100644 --- a/adapter/uhdf2/security/BUILD.gn +++ b/adapter/uhdf2/security/BUILD.gn @@ -39,13 +39,13 @@ ohos_shared_library("libhdf_sec") { "$hdf_uhdf_path/utils:libhdf_utils", ] - if (hilog_enable) { - external_deps = [ "hilog:libhilog" ] - } if (is_standard_system) { - if (c_utils_enable) { - external_deps += [ "c_utils:utils" ] - } + external_deps = [ + "c_utils:utils", + "hilog:libhilog", + ] + } else { + external_deps = [ "hilog:libhilog" ] } install_images = [ chipset_base_dir ] diff --git a/adapter/uhdf2/uhdf.gni b/adapter/uhdf2/uhdf.gni index 0011eab54..18c8b4928 100644 --- a/adapter/uhdf2/uhdf.gni +++ b/adapter/uhdf2/uhdf.gni @@ -13,35 +13,3 @@ hdf_framework_path = "//drivers/hdf_core/framework" hdf_uhdf_path = "//drivers/hdf_core/adapter/uhdf2" - -declare_args() { - samgr_enable = true - if (defined(global_parts_info) && - !defined(global_parts_info.systemabilitymgr_samgr)) { - samgr_enable = false - } - - c_utils_enable = true - if (defined(global_parts_info) && - !defined(global_parts_info.commonlibrary_c_utils)) { - c_utils_enable = false - } - - hilog_enable = true - if (defined(global_parts_info) && - !defined(global_parts_info.hiviewdfx_hilog)) { - hilog_enable = false - } - - selinux_adapter_enable = true - if (defined(global_parts_info) && - !defined(global_parts_info.security_selinux_adapter)) { - selinux_adapter_enable = false - } - - hilog_lite_enable = true - if (defined(global_parts_info) && - !defined(global_parts_info.hiviewdfx_hilog_lite)) { - hilog_lite_enable = false - } -} diff --git a/adapter/uhdf2/utils/BUILD.gn b/adapter/uhdf2/utils/BUILD.gn index f78b23d49..8d3c488fb 100644 --- a/adapter/uhdf2/utils/BUILD.gn +++ b/adapter/uhdf2/utils/BUILD.gn @@ -82,10 +82,8 @@ if (defined(ohos_lite)) { "$hdf_uhdf_path/utils/src/hcs_parser/hcs_dm_parser.c", ] - if (hilog_lite_enable) { - public_deps = - [ "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared" ] - } + public_deps = + [ "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared" ] subsystem_name = "hdf" part_name = "hdf_core" @@ -159,13 +157,13 @@ if (defined(ohos_lite)) { "$hdf_uhdf_path/utils/src/shared_mem.cpp", ] - if (hilog_enable) { - external_deps = [ "hilog:libhilog" ] - } if (is_standard_system) { - if (c_utils_enable) { - external_deps += [ "c_utils:utils" ] - } + external_deps = [ + "c_utils:utils", + "hilog:libhilog", + ] + } else { + external_deps = [ "hilog:libhilog" ] } innerapi_tags = [ "chipsetsdk" ] diff --git a/framework/sample/platform/uart/dev/BUILD.gn b/framework/sample/platform/uart/dev/BUILD.gn index 168719bbc..6c0306142 100644 --- a/framework/sample/platform/uart/dev/BUILD.gn +++ b/framework/sample/platform/uart/dev/BUILD.gn @@ -27,10 +27,8 @@ executable("hello_uart") { deps = [ "$hdf_adapter_path/uhdf/manager:hdf_core", "$hdf_adapter_path/uhdf/posix:hdf_posix_osal", + "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", ] - if (hilog_lite_enable) { - deps += [ "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared" ] - } public_deps = [ "//third_party/bounds_checking_function:libsec_shared" ] defines = [ "__USER__" ] diff --git a/framework/sample/platform/uart/dispatch/BUILD.gn b/framework/sample/platform/uart/dispatch/BUILD.gn index de5c18f42..2e5681c7f 100644 --- a/framework/sample/platform/uart/dispatch/BUILD.gn +++ b/framework/sample/platform/uart/dispatch/BUILD.gn @@ -30,10 +30,8 @@ executable("hello_uart_dispatch") { deps = [ "$hdf_adapter_path/uhdf/manager:hdf_core", "$hdf_adapter_path/uhdf/posix:hdf_posix_osal", + "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", ] - if (hilog_lite_enable) { - deps += [ "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared" ] - } public_deps = [ "//third_party/bounds_checking_function:libsec_shared" ] defines = [ "__USER__" ] diff --git a/framework/tools/hdf_dbg/BUILD.gn b/framework/tools/hdf_dbg/BUILD.gn index 2d7e2e718..d1c0eead2 100644 --- a/framework/tools/hdf_dbg/BUILD.gn +++ b/framework/tools/hdf_dbg/BUILD.gn @@ -15,10 +15,10 @@ ohos_executable("hdf_dbg") { "../../../adapter/uhdf2/hdi:libhdi", "../../../adapter/uhdf2/utils/:libhdf_utils", ] - external_deps = [ "ipc:ipc_single" ] - if (c_utils_enable) { - external_deps += [ "c_utils:utils" ] - } + external_deps = [ + "c_utils:utils", + "ipc:ipc_single", + ] } install_enable = false -- Gitee