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 cflags_cc = [ 27 "-fdata-sections", 28 "-ffunction-sections", 29 "-fvisibility=hidden", 30 "-fstack-protector-strong", 31 "-Os", 32 ] 33 34 include_dirs = [ 35 "${worksched_root_path}/utils/native/include", 36 "${worksched_root_path}/frameworks/include", 37 ] 38 39 if (!defined(defines)) { 40 defines = [] 41 } 42 43 if (product_name != "ohos-sdk") { 44 deps = [ 45 "${worksched_frameworks_path}:workschedclient", 46 "${worksched_utils_path}:workschedutils", 47 ] 48 external_deps = [ 49 "ability_base:base", 50 "ability_base:want", 51 "c_utils:utils", 52 "hilog:libhilog", 53 "ipc:ipc_core", 54 "napi:ace_napi", 55 "napi:cj_bind_ffi", 56 ] 57 sources = [ "work_scheduler/work_scheduler_ffi.cpp" ] 58 } else { 59 defines += [ "PREVIEWER" ] 60 sources = [ "work_scheduler/work_scheduler_mock.cpp" ] 61 external_deps = [ "napi:cj_bind_ffi" ] 62 } 63 64 if (current_os == "ohos") { 65 defines += [ "OHOS_PLATFORM" ] 66 } 67 68 if (current_os == "mingw") { 69 defines += [ "WINDOWS_PLATFORM" ] 70 } 71 72 innerapi_tags = [ "platformsdk" ] 73 subsystem_name = "resourceschedule" 74 part_name = "${worksched_native_part_name}" 75} 76