# 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. import("//base/hiviewdfx/hitrace/hitrace.gni") import("//build/ohos.gni") config("libhitrace_pub_config") { visibility = [ ":*" ] include_dirs = [ "include" ] } ohos_shared_library("libhitracechain") { branch_protector_ret = "pac_ret" public_configs = [ ":libhitrace_pub_config" ] deps = [ "$hitrace_frameworks_path/native:hitracechain_source" ] cflags = [ "-fstack-protector-strong" ] if (defined(ohos_lite)) { external_deps = [ "hilog_lite:hilog_lite" ] } else { external_deps = [ "hilog:libhilog" ] } output_extension = "so" if (build_public_version) { install_enable = true } else { install_enable = false } innerapi_tags = [ "chipsetsdk_indirect", "platformsdk", ] version_script = "libhitracechain.map" install_images = [ "system", "updater", ] part_name = "hitrace" subsystem_name = "hiviewdfx" } config("hitrace_meter_config") { visibility = [ ":*" ] include_dirs = [ "include/hitrace_meter" ] } ohos_static_library("hitrace_inner") { branch_protector_ret = "pac_ret" include_dirs = [ "include/hitrace_meter", "include", "$hitrace_frameworks_path/include/", ] sources = [ "src/hitrace_meter.cpp", "src/hitrace_meter_c.c", "src/hitrace_meter_wrapper.cpp", ] external_deps = [ "bounds_checking_function:libsec_shared", "init:libbeget_proxy", "init:libbegetutil", ] if (defined(ohos_lite)) { external_deps += [ "hilog_lite:hilog_lite" ] } else { external_deps += [ "hilog:libhilog" ] } part_name = "hitrace" subsystem_name = "hiviewdfx" } config("hitrace_dump_config") { visibility = [ ":*" ] include_dirs = [ "include" ] } ohos_shared_library("hitrace_dump") { include_dirs = [ "include", "$hitrace_cmd_path/include", "$hitrace_frameworks_path/include", ] public_configs = [ ":hitrace_dump_config" ] sources = [ "$hitrace_cmd_path/src/hitrace_osal.cpp", "$hitrace_frameworks_path/native/common_utils.cpp", "$hitrace_frameworks_path/native/dynamic_buffer.cpp", "src/hitrace_dump.cpp", ] if (hitrace_double_tracebuffer_size) { defines = [ "DOUBLE_TRACEBUFFER_ENABLE" ] } deps = [ "$hitrace_config_path:hitrace_tags" ] external_deps = [ "bounds_checking_function:libsec_shared", "cJSON:cjson", "init:libbegetutil", ] if (defined(ohos_lite)) { external_deps += [ "hilog_lite:hilog_lite" ] } else { external_deps += [ "hilog:libhilog" ] } version_script = "hitrace.map" innerapi_tags = [ "platformsdk" ] part_name = "hitrace" subsystem_name = "hiviewdfx" } ohos_shared_library("hitrace_meter") { branch_protector_ret = "pac_ret" public_configs = [ ":hitrace_meter_config" ] deps = [ ":hitrace_etc", ":hitrace_inner", ":libhitracechain", ] external_deps = [ "bounds_checking_function:libsec_shared" ] if (defined(ohos_lite)) { external_deps += [ "hilog_lite:hilog_lite" ] } else { external_deps += [ "hilog:libhilog" ] } version_script = "hitrace.map" output_extension = "so" innerapi_tags = [ "chipsetsdk", "platformsdk", "sasdk", ] part_name = "hitrace" install_images = [ "system", "updater", ] subsystem_name = "hiviewdfx" } ohos_prebuilt_etc("hitrace.para") { source = "hitrace.para" install_images = [ "system", "updater", ] module_install_dir = "etc/param" part_name = "hitrace" subsystem_name = "hiviewdfx" } ohos_prebuilt_etc("hitrace.para.dac") { source = "hitrace.para.dac" install_images = [ "system", "updater", ] module_install_dir = "etc/param" part_name = "hitrace" subsystem_name = "hiviewdfx" } group("hitrace_etc") { deps = [ ":hitrace.para", ":hitrace.para.dac", ] }