# Copyright (c) 2020 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/hilog/hilog.gni") import("//build/ohos.gni") ohos_source_set("libhilognapi_src") { defines = [] include_dirs = [ "//base/hiviewdfx/hilog/frameworks/libhilog/param/include", "//base/hiviewdfx/hilog/frameworks/libhilog/include", "//base/hiviewdfx/hilog/interfaces/js/kits/napi/src/common/napi", "//base/hiviewdfx/hilog/interfaces/js/kits/napi/src/hilog/include/context", ] sources = [ "src/common/napi/n_class.cpp", "src/common/napi/n_func_arg.cpp", "src/common/napi/n_val.cpp", "src/hilog/module.cpp", "src/hilog/src/hilog_napi.cpp", "src/hilog/src/hilog_napi_base.cpp", ] external_deps = [ "bounds_checking_function:libsec_shared", "node:node_header_notice", ] if (is_mingw || is_mac || is_linux) { deps = [ "//foundation/arkui/napi:ace_napi" ] } else { deps = [ "../../../../interfaces/native/innerkits:libhilog" ] external_deps += [ "napi:ace_napi" ] } cflags_cc = [] if (is_mingw) { deps += [ "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog_windows", ] defines += [ "__WINDOWS__" ] cflags_cc += [ "-std=c++17" ] } else if (is_mac) { deps += [ "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog_mac" ] defines += [ "__MAC__" ] } else if (is_linux) { deps += [ "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog_linux" ] defines += [ "__LINUX__" ] } subsystem_name = "hiviewdfx" part_name = "hilog" } config("libhilog_js_cfg") { visibility = [ "*:*" ] include_dirs = [ "include" ] } ohos_shared_library("libhilognapi") { sanitize = { cfi = true cfi_cross_dso = true debug = false } deps = [ ":libhilognapi_src" ] public_configs = [ ":libhilog_js_cfg" ] configs = [ ":libhilog_js_cfg" ] output_name = "libhilog_napi" relative_install_dir = "module" subsystem_name = "hiviewdfx" part_name = "hilog" }