• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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")
15
16config("cj_web_public_config") {
17  visibility = [ ":*" ]
18  include_dirs = [
19    "include",
20    "$target_gen_dir/../napi/protos",
21    "../../native",
22  ]
23}
24
25ohos_shared_library("cj_webview_ffi") {
26  branch_protector_ret = "pac_ret"
27
28  public_configs = [ ":cj_web_public_config" ]
29
30  if (!defined(defines)) {
31    defines = []
32  }
33
34  if (product_name != "ohos-sdk") {
35    sources = [
36      "$target_gen_dir/../napi/protos/web_download.pb.cc",
37      "$target_gen_dir/../napi/protos/web_download.pb.h",
38      "src/geolocation_permission.cpp",
39      "src/geolocation_permission_ffi.cpp",
40      "src/nweb_message_ext.cpp",
41      "src/web_cookie_manager.cpp",
42      "src/web_cookie_manager_ffi.cpp",
43      "src/web_data_base.cpp",
44      "src/web_data_base_ffi.cpp",
45      "src/web_download_delegate_impl.cpp",
46      "src/web_download_ffi.cpp",
47      "src/web_download_item_impl.cpp",
48      "src/web_download_manager_impl.cpp",
49      "src/web_native_media_player.cpp",
50      "src/web_runtime_delegate.cpp",
51      "src/web_scheme_handler_request_impl.cpp",
52      "src/web_scheme_handler_response_ffi.cpp",
53      "src/web_scheme_handler_response_impl.cpp",
54      "src/web_storage.cpp",
55      "src/web_storage_ffi.cpp",
56      "src/webview_adsblock_ffi_impl.cpp",
57      "src/webview_adsblock_manager.cpp",
58      "src/webview_controller_impl.cpp",
59      "src/webview_ffi.cpp",
60      "src/webview_function.cpp",
61      "src/webview_hasimage_callback.cpp",
62      "src/webview_javascript_execute_callback.cpp",
63      "src/webview_javascript_result_callback.cpp",
64      "src/webview_media_ffi_impl.cpp",
65      "src/webview_message_ffi.cpp",
66      "src/webview_scheme_ffi_impl.cpp",
67      "src/webview_utils.cpp",
68    ]
69
70    deps = [
71      "../../../ohos_adapter:nweb_ohos_adapter",
72      "../../../ohos_nweb:libnweb",
73      "../../native:ohweb",
74      "../napi/protos:proto_gen",
75    ]
76
77    external_deps = [
78      "ability_base:extractortool",
79      "ability_runtime:app_context",
80      "bundle_framework:appexecfwk_core",
81      "c_utils:utils",
82      "common_event_service:cesfwk_innerkits",
83      "hilog:libhilog",
84      "image_framework:cj_image_ffi",
85      "image_framework:image",
86      "image_framework:image_native",
87      "init:libbegetutil",
88      "ipc:ipc_core",
89      "napi:ace_napi",
90      "napi:cj_bind_ffi",
91      "napi:cj_bind_native",
92      "protobuf:protobuf_lite",
93      "samgr:samgr_proxy",
94    ]
95  } else {
96    defines += [ "PREVIEWER" ]
97    sources = [ "src/webview_mock.cpp" ]
98    external_deps = [ "napi:cj_bind_ffi" ]
99  }
100
101  if (current_os == "ohos") {
102    defines += [ "OHOS_PLATFORM" ]
103  }
104
105  if (current_os == "mingw") {
106    defines += [ "WINDOWS_PLATFORM" ]
107  }
108  innerapi_tags = [ "platformsdk" ]
109  part_name = "webview"
110  subsystem_name = "web"
111}
112