1# Copyright (c) 2021-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("//build/ohos/ndk/ndk.gni") 16 17ohos_ndk_headers("web_header") { 18 dest_dir = "$ndk_headers_out_dir/web/" 19 sources = [ 20 "arkweb_interface.h", 21 "arkweb_type.h", 22 "native_interface_arkweb.h", 23 ] 24} 25 26ohos_ndk_library("libohweb") { 27 cflags = [ "-fstack-protector-all" ] 28 min_compact_version = "11" 29 ndk_description_file = "./libohweb.ndk.json" 30 system_capability = "SystemCapability.Web.Webview.Core" 31 output_name = "ohweb" 32} 33 34ohos_shared_library("ohweb") { 35 if (target_cpu == "arm64") { 36 branch_protector_ret = "pac_ret" 37 branch_protector_frt = "bti" 38 } 39 40 output_extension = "so" 41 include_dirs = [ "../../ohos_nweb/include" ] 42 43 sources = [ 44 "arkweb_interface.cpp", 45 "arkweb_scheme_handler.cpp", 46 "native_arkweb_utils.cpp", 47 "native_interface_arkweb.cpp", 48 "native_javascript_execute_callback.cpp", 49 ] 50 51 external_deps = [ 52 "c_utils:utils", 53 "hilog:libhilog", 54 "napi:ace_napi", 55 ] 56 57 deps = [ "../../ohos_nweb:libnweb" ] 58 relative_install_dir = "ndk" 59 part_name = "webview" 60 subsystem_name = "web" 61} 62 63group("webview_ndk") { 64 deps = [ 65 ":libohweb", 66 ":ohweb", 67 ] 68} 69