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