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/config/components/ace_engine/ace_gen_obj.gni") 15import("//build/ohos.gni") 16import("//commonlibrary/ets_utils/ets_utils_config.gni") 17 18process_sources = [ 19 "js_childprocess.cpp", 20 "js_process.cpp", 21 "native_module_process.cpp", 22] 23 24if (target_os == "ios" || (!is_arkui_x && host_os == "mac")) { 25 process_sources += [ "$platform_root/ios/process_helper.cpp" ] 26} else { 27 process_sources += [ "$platform_root/default/process_helper.cpp" ] 28} 29 30ohos_shared_library("process") { 31 branch_protector_ret = "pac_ret" 32 sanitize = { 33 cfi = true 34 cfi_cross_dso = true 35 debug = false 36 } 37 deps = [ ":process_static" ] 38 external_deps = [ "hilog:libhilog" ] 39 subsystem_name = "commonlibrary" 40 part_name = "ets_utils" 41 relative_install_dir = "module" 42} 43 44ohos_source_set("process_static") { 45 branch_protector_ret = "pac_ret" 46 sanitize = { 47 cfi = true 48 cfi_cross_dso = true 49 debug = false 50 } 51 include_dirs = [ 52 "$process_root", 53 platform_root, 54 ets_util_path, 55 ] 56 57 sources = process_sources 58 59 deps = [] 60 if (is_arkui_x) { 61 include_dirs += [ 62 "$napi_root/interfaces/kits", 63 "$plugins_root/hilog/include", 64 "$plugins_root/interfaces", 65 "//base/hiviewdfx/hilog/interfaces/native/innerkits/include", 66 ] 67 68 if (target_os == "android") { 69 defines = [ "ANDROID_PLATFORM" ] 70 } 71 if (target_os == "ios") { 72 defines = [ "IOS_PLATFORM" ] 73 } 74 deps += [ 75 "$plugins_root/libs/icu:icu_${target_os}", 76 "$plugins_root/libs/napi:napi_${target_os}", 77 "$plugins_root/libs/securec:sec_${target_os}", 78 ] 79 } else { 80 external_deps = [ "napi:ace_napi" ] 81 if (is_standard_system) { 82 external_deps += [ "hilog:libhilog" ] 83 } else { 84 external_deps += [ 85 "c_utils:utils", 86 "hilog:libhilog", 87 ] 88 } 89 external_deps += [ 90 "bounds_checking_function:libsec_shared", 91 "icu:shared_icuuc", 92 ] 93 } 94 subsystem_name = "commonlibrary" 95 part_name = "ets_utils" 96} 97 98group("process_packages") { 99 deps = [ ":process" ] 100} 101