# 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") ohos_shared_library("timer") { branch_protector_ret = "pac_ret" sanitize = { cfi = true cfi_cross_dso = true debug = false } include_dirs = [ "../../js_concurrent_module/common", "../timer", ets_util_path, ] sources = [ "../../js_concurrent_module/common/helper/napi_helper.cpp", "timer.cpp", ] deps = [] defines = [] external_deps = [ "napi:ace_napi" ] if (is_linux && current_toolchain == host_toolchain) { deps += [ "$hilog_linux" ] defines += [ "LINUX_PLATFORM", "PREVIEW", ] } else { if (is_standard_system) { external_deps += [ "hilog:libhilog" ] } else { external_deps += [ "hilog:libhilog" ] } } if (!is_mingw && !is_mac && !is_linux && product_name != "ohos-sdk") { external_deps += [ "napi:ace_container_scope" ] defines += [ "ENABLE_CONTAINER_SCOPE" ] } if (is_mingw) { defines += [ "WINDOWS_PLATFORM", "NOGDI", ] } cflags = [ "-std=c++17" ] subsystem_name = "commonlibrary" innerapi_tags = [ "platformsdk" ] part_name = "ets_utils" } ohos_source_set("timer_static") { branch_protector_ret = "pac_ret" sanitize = { cfi = true cfi_cross_dso = true debug = false } include_dirs = [ js_concurrent_module_common, "../timer", ets_util_path, ] sources = [ "$js_concurrent_module_common/helper/napi_helper.cpp", "timer.cpp", ] deps = [] defines = [] configs = [ "$napi_root:ace_napi_config" ] if (is_arkui_x) { include_dirs += [ "$plugins_root/hilog/include", "$plugins_root/interfaces", "//base/hiviewdfx/hilog/interfaces/native/innerkits/include", ] deps += [ "$plugins_root/libs/napi:napi_${target_os}", "$plugins_root/libs/uv:uv_${target_os}", ] if (target_os == "android") { defines += [ "ANDROID_PLATFORM" ] } if (target_os == "ios") { defines += [ "IOS_PLATFORM" ] } } else { deps += [ "$napi_root:ace_napi" ] } if (!is_mingw && !is_mac && !is_linux && product_name != "ohos-sdk") { deps += [ "$napi_root:ace_container_scope_static" ] defines += [ "ENABLE_CONTAINER_SCOPE" ] } subsystem_name = "commonlibrary" part_name = "ets_utils" } group("timer_packages") { deps = [ ":timer" ] }