# Copyright (c) 2021 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/faultloggerd/faultloggerd.gni") if (defined(ohos_lite)) { executable("crasher_cpp") { cflags = [ "-funwind-tables", "-Wno-frame-larger-than", ] defines = [ "is_ohos_lite" ] visibility = [ "*:*" ] include_dirs = [ ".", "$faultloggerd_interfaces_path/common", "$faultloggerd_interfaces_path/innerkits/async_stack/include", "$hilog_lite_include_path", ] sources = [ "dfx_crasher.cpp" ] deps = [ "$faultloggerd_interfaces_path/innerkits/async_stack:libasync_stack", "$hilog_lite_deps_path", ] external_deps = [ "bounds_checking_function:libsec_shared" ] } } else { config("crasher_config") { visibility = [ ":*" ] include_dirs = [ ".", "$faultloggerd_interfaces_path/common", ] cflags = [ "-DHAS_HITRACE", "-DHAS_CRASH_EXAMPLES", "-Wno-frame-larger-than", "-Wno-frame-address", ] cflags_c = [ "-Wno-frame-larger-than" ] cflags_cc = [ "-Wno-frame-larger-than", "-o0", ] ldflags = [ "-Wno-frame-larger-than" ] } ohos_executable("crasher_cpp") { configs = [ ":crasher_config", "$faultloggerd_path/common/build:coverage_flags", ] sources = [ "dfx_crasher.cpp" ] sources += [ "faults/ipc_issues.cpp", "faults/multi_thread_container_access.cpp", "faults/nullpointer_dereference.cpp", "faults/parcel_sample.cpp", "faults/remote_object_interface_proxy.cpp", "faults/remote_object_interface_stub.cpp", ] branch_protector_ret = "pac_ret" deps = [ "$faultloggerd_interfaces_path/innerkits/async_stack:libasync_stack" ] external_deps = [ "c_utils:utils", "ffrt:libffrt", "hilog:libhilog", "hitrace:libhitracechain", "ipc:ipc_single", "libuv:uv", ] part_name = "faultloggerd" subsystem_name = "hiviewdfx" } }