1# Copyright (c) 2025 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/hilog/hilog.gni") 15import("//build/config/components/ets_frontend/ets2abc_config.gni") 16import("//build/ohos.gni") 17 18ohos_shared_library("hilog_ani") { 19 include_dirs = [ "./include" ] 20 sources = [ 21 "./src/ani_util.cpp", 22 "./src/hilog_ani.cpp", 23 "./src/hilog_ani_base.cpp", 24 ] 25 configs = [ "../../../../frameworks/libhilog:libhilog_config" ] 26 27 sanitize = { 28 cfi = true 29 cfi_cross_dso = true 30 debug = false 31 } 32 deps = [] 33 34 external_deps = [ 35 "bounds_checking_function:libsec_shared", 36 "runtime_core:ani", 37 "runtime_core:libarkruntime", 38 ] 39 40 if (!is_mingw && !is_mac && !is_linux) { 41 deps += [ "../../../native/innerkits:libhilog" ] 42 } 43 44 cflags_cc = [] 45 if (is_mingw) { 46 deps += [ "../../../native/innerkits:libhilog_windows" ] 47 defines += [ "__WINDOWS__" ] 48 cflags_cc += [ "-std=c++17" ] 49 } else if (is_mac) { 50 deps += [ "../../../native/innerkits:libhilog_mac" ] 51 defines += [ "__MAC__" ] 52 } else if (is_linux) { 53 deps += [ "../../../native/innerkits:libhilog_linux" ] 54 defines += [ "__LINUX__" ] 55 } 56 57 subsystem_name = "hiviewdfx" 58 part_name = "hilog" 59 output_extension = "so" 60} 61 62generate_static_abc("hilog") { 63 base_url = "./ets" 64 files = [ "./ets/@ohos.hilog.ets" ] 65 is_boot_abc = "True" 66 device_dst_file = "/system/framework/hilog.abc" 67} 68 69ohos_prebuilt_etc("hilog_etc") { 70 source = "$target_out_dir/hilog.abc" 71 module_install_dir = "framework" 72 subsystem_name = "hiviewdfx" 73 part_name = "hilog" 74 deps = [ ":hilog" ] 75} 76