1# Copyright (c) 2021-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("//foundation/communication/netstack/netstack_config.gni") 16 17ohos_shared_library("fetch") { 18 sanitize = { 19 cfi = true 20 cfi_cross_dso = true 21 debug = false 22 } 23 24 branch_protector_ret = "pac_ret" 25 26 include_dirs = [ 27 "async_context/include", 28 "async_work/include", 29 "constant/include", 30 "fetch_exec/include", 31 "fetch_module/include", 32 "options/include", 33 ] 34 35 sources = [ 36 "async_context/src/fetch_context.cpp", 37 "async_work/src/fetch_async_work.cpp", 38 "constant/src/constant.cpp", 39 "fetch_exec/src/fetch_exec.cpp", 40 "fetch_module/src/fetch_module.cpp", 41 "options/src/fetch_request.cpp", 42 "options/src/fetch_response.cpp", 43 ] 44 45 cflags = [ 46 "-fstack-protector-strong", 47 "-D_FORTIFY_SOURCE=2", 48 "-O2", 49 ] 50 51 cflags_cc = [ 52 "-fstack-protector-strong", 53 "-D_FORTIFY_SOURCE=2", 54 "-O2", 55 ] 56 57 deps = [ "$NETSTACK_DIR/utils/napi_utils:napi_utils" ] 58 59 external_deps = [ 60 "curl:curl_shared", 61 "hilog:libhilog", 62 "napi:ace_napi", 63 ] 64 65 relative_install_dir = "module" 66 part_name = "netstack" 67 subsystem_name = "communication" 68} 69