1# Copyright (c) 2024 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") 15import("//build/ohos/ace/ace.gni") 16import("//foundation/resourceschedule/work_scheduler/workscheduler.gni") 17 18ohos_shared_library("cj_work_scheduler_ffi") { 19 branch_protector_ret = "pac_ret" 20 21 sanitize = { 22 cfi = true 23 cfi_cross_dso = true 24 debug = false 25 } 26 27 include_dirs = [ 28 "${worksched_root_path}/utils/native/include", 29 "${worksched_root_path}/frameworks/include", 30 ] 31 32 if (!defined(defines)) { 33 defines = [] 34 } 35 36 if (product_name != "ohos-sdk") { 37 deps = [ 38 "${worksched_frameworks_path}:workschedclient", 39 "${worksched_utils_path}:workschedutils", 40 ] 41 external_deps = [ 42 "ability_base:base", 43 "ability_base:want", 44 "c_utils:utils", 45 "hilog:libhilog", 46 "ipc:ipc_core", 47 "napi:ace_napi", 48 "napi:cj_bind_ffi", 49 ] 50 sources = [ "work_scheduler/work_scheduler_ffi.cpp" ] 51 } else { 52 defines += [ "PREVIEWER" ] 53 sources = [ "work_scheduler/work_scheduler_mock.cpp" ] 54 external_deps = [ "napi:cj_bind_ffi" ] 55 } 56 57 if (current_os == "ohos") { 58 defines += [ "OHOS_PLATFORM" ] 59 } 60 61 if (current_os == "mingw") { 62 defines += [ "WINDOWS_PLATFORM" ] 63 } 64 65 innerapi_tags = [ "platformsdk" ] 66 subsystem_name = "resourceschedule" 67 part_name = "${worksched_native_part_name}" 68} 69