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") 15import("//commonlibrary/ets_utils/ets_utils_config.gni") 16import("//foundation/arkui/ace_engine/ace_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 "//third_party/icu/icu4c/source/common", 63 "//third_party/node/src", 64 "$napi_root/interfaces/kits", 65 "$plugins_root/hilog/include", 66 "$plugins_root/interfaces", 67 "//base/hiviewdfx/hilog/interfaces/native/innerkits/include", 68 ] 69 70 if (target_os == "android") { 71 defines = [ "ANDROID_PLATFORM" ] 72 } 73 if (target_os == "ios") { 74 defines = [ "IOS_PLATFORM" ] 75 } 76 deps += [ 77 "$plugins_root/libs/icu:icu_${target_os}", 78 "$plugins_root/libs/napi:napi_${target_os}", 79 "$plugins_root/libs/securec:sec_${target_os}", 80 ] 81 } else { 82 external_deps = [ "napi:ace_napi" ] 83 if (is_standard_system) { 84 external_deps += [ "hilog:libhilog" ] 85 } else { 86 external_deps += [ 87 "c_utils:utils", 88 "hilog:libhilog", 89 ] 90 } 91 deps += [ "//third_party/icu/icu4c:shared_icuuc" ] 92 93 external_deps += [ "bounds_checking_function:libsec_shared" ] 94 } 95 subsystem_name = "commonlibrary" 96 part_name = "ets_utils" 97} 98 99group("process_packages") { 100 deps = [ ":process" ] 101} 102