1# Copyright (c) 2022 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("//build/ohos.gni") 15 16ohos_shared_library("taskpool") { 17 include_dirs = [ 18 "//commonlibrary/ets_utils/js_concurrent_module/common", 19 "//commonlibrary/ets_utils/js_concurrent_module/taskpool", 20 ] 21 22 sources = [ 23 "../common/helper/napi_helper.cpp", 24 "../common/plugin/timer.cpp", 25 "native_module_taskpool.cpp", 26 "task.cpp", 27 "task_manager.cpp", 28 "task_queue.cpp", 29 "task_runner.cpp", 30 "taskpool.cpp", 31 "thread.cpp", 32 "worker.cpp", 33 ] 34 35 deps = [ "//foundation/arkui/napi:ace_napi" ] 36 37 external_deps = [] 38 39 if (is_linux && current_toolchain == host_toolchain) { 40 deps += 41 [ "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog_linux" ] 42 defines = [ 43 "LINUX_PLATFORM", 44 "PREVIEW", 45 ] 46 } else { 47 if (is_standard_system) { 48 external_deps = [ "hiviewdfx_hilog_native:libhilog" ] 49 } else { 50 external_deps = [ "hilog:libhilog" ] 51 } 52 } 53 54 external_deps += [ "hitrace_native:hitrace_meter" ] 55 56 subsystem_name = "commonlibrary" 57 part_name = "ets_utils" 58 59 relative_install_dir = "module" 60} 61 62group("taskpool_packages") { 63 deps = [ ":taskpool" ] 64} 65