1# Copyright (c) 2021-2022 Huawei Device Co., Ltd. 2# Licensed under the Apache License, Version 2.0 (the "License"); 3# you may not use this file except in compliance with the License. 4# You may obtain a copy of the License at 5# 6# http://www.apache.org/licenses/LICENSE-2.0 7# 8# Unless required by applicable law or agreed to in writing, software 9# distributed under the License is distributed on an "AS IS" BASIS, 10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11# See the License for the specific language governing permissions and 12# limitations under the License. 13 14import("//base/hiviewdfx/faultloggerd/faultloggerd.gni") 15 16if (defined(ohos_lite)) { 17 shared_library("libfaultloggerd") { 18 visibility = [ "*:*" ] 19 20 include_dirs = [ 21 ".", 22 "include", 23 "$c_utils_include_path", 24 "$faultloggerd_common_path/cutil", 25 "$faultloggerd_common_path/dfxlog", 26 "$faultloggerd_common_path/dfxutil", 27 "$hilog_lite_include_path", 28 ] 29 30 sources = [ 31 "faultloggerd_client.cpp", 32 "faultloggerd_socket.cpp", 33 ] 34 cflags = [ "-fstack-protector-strong" ] 35 sources += [ "$c_utils_src_path/directory_ex.cpp" ] 36 37 deps = [ 38 "$faultloggerd_path/common/cutil:dfx_cutil", 39 "$faultloggerd_path/common/dfxlog:dfx_hilog", 40 "$faultloggerd_path/common/dfxutil:dfx_util", 41 ] 42 43 external_deps = [ 44 "bounds_checking_function:libsec_shared", 45 "hilog_lite:hilog_shared", 46 "init:libbegetutil", 47 ] 48 49 defines = [ "is_ohos_lite" ] 50 if (!faultloggerd_hisysevent_enable) { 51 defines += [ "HISYSEVENT_DISABLE" ] 52 } 53 } 54} else { 55 config("faultloggerd_client_config") { 56 visibility = [ "*:*" ] 57 58 include_dirs = [ 59 "include", 60 "$faultloggerd_interfaces_path/common", 61 ] 62 } 63 64 ohos_shared_library("libfaultloggerd") { 65 branch_protector_ret = "pac_ret" 66 public_configs = [ 67 ":faultloggerd_client_config", 68 "$faultloggerd_path/common/build:coverage_flags", 69 ] 70 71 sources = [ 72 "faultloggerd_client.cpp", 73 "faultloggerd_socket.cpp", 74 ] 75 cflags = [ "-fstack-protector-strong" ] 76 include_dirs = [ "$faultloggerd_common_path/dfxutil" ] 77 version_script = "libfaultloggerd.map" 78 deps = [ 79 "$faultloggerd_common_path/cutil:dfx_cutil", 80 "$faultloggerd_common_path/dfxlog:dfx_hilog", 81 "$faultloggerd_common_path/dfxutil:dfx_util", 82 ] 83 external_deps = [ 84 "bounds_checking_function:libsec_shared", 85 "hilog:libhilog", 86 "init:libbegetutil", 87 ] 88 install_images = [ 89 "system", 90 "updater", 91 ] 92 innerapi_tags = [ 93 "chipsetsdk_sp_indirect", 94 "platformsdk_indirect", 95 ] 96 part_name = "faultloggerd" 97 subsystem_name = "hiviewdfx" 98 } 99} 100