# Copyright (c) 2023 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("//build/ohos.gni") import("//commonlibrary/ets_utils/ets_utils_config.gni") config("console_public_config") { visibility = [ ":*" ] include_dirs = [ "${sys_module}/console" ] } ohos_shared_library("console") { branch_protector_ret = "pac_ret" sanitize = { cfi = true cfi_cross_dso = true debug = false } include_dirs = [ "../../js_concurrent_module/common", "../console", ] public_configs = [ ":console_public_config" ] sources = [ "../../js_concurrent_module/common/helper/napi_helper.cpp", "console.cpp", ] deps = [] external_deps = [ "napi:ace_napi" ] if (is_linux && current_toolchain == host_toolchain) { deps += [ "$hilog_linux" ] defines = [ "LINUX_PLATFORM", "PREVIEW", ] } else if (is_mingw) { external_deps += [ "hilog:libhilog" ] defines = [ "WINDOWS_PLATFORM", "NOGDI", ] } else if (is_mac && !is_arkui_x) { external_deps += [ "hilog:libhilog" ] } else if (is_standard_system) { external_deps += [ "hilog:libhilog" ] } else if (is_arkui_x) { if (target_os == "ios") { deps += [ "$hilog_ios" ] } else if (target_os == "android") { deps += [ "$hilog_android" ] } } else { external_deps += [ "hilog:libhilog" ] } cflags = [ "-std=c++17" ] subsystem_name = "commonlibrary" innerapi_tags = [ "platformsdk_indirect" ] part_name = "ets_utils" } ohos_source_set("console_static") { branch_protector_ret = "pac_ret" sanitize = { cfi = true cfi_cross_dso = true debug = false } include_dirs = [ js_concurrent_module_common, "../console", ] sources = [ "$js_concurrent_module_common/helper/napi_helper.cpp", "console.cpp", ] deps = [] defines = [] if (is_arkui_x) { include_dirs += [ "$plugins_root/hilog/include", "$plugins_root/interfaces", ] deps += [ "$plugins_root/libs/napi:napi_${target_os}" ] if (target_os == "android") { defines += [ "ANDROID_PLATFORM" ] } if (target_os == "ios") { defines += [ "IOS_PLATFORM" ] } } else { deps += [ "$napi_root:ace_napi" ] } subsystem_name = "commonlibrary" part_name = "ets_utils" } group("console_packages") { deps = [ ":console" ] }