# Copyright (c) 2022 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//build/ohos.gni") config("cj_web_public_config") { visibility = [ ":*" ] include_dirs = [ "include", "../../native", ] } ohos_shared_library("cj_webview_ffi") { branch_protector_ret = "pac_ret" branch_protector_frt = "bti" public_configs = [ ":cj_web_public_config" ] if (!defined(defines)) { defines = [] } if (product_name != "ohos-sdk") { sources = [ "src/web_cookie_manager.cpp", "src/webview_controller_impl.cpp", "src/webview_ffi.cpp", "src/webview_javascript_execute_callback.cpp", "src/webview_javascript_result_callback.cpp", "src/webview_utils.cpp", ] deps = [ "../../../ohos_adapter:nweb_ohos_adapter", "../../../ohos_nweb:libnweb", "../../native:ohweb", ] external_deps = [ "ability_runtime:app_context", "bundle_framework:appexecfwk_core", "c_utils:utils", "common_event_service:cesfwk_innerkits", "hilog:libhilog", "image_framework:cj_image_ffi", "image_framework:image", "image_framework:image_native", "init:libbegetutil", "napi:ace_napi", "napi:cj_bind_ffi", "napi:cj_bind_native", ] } else { defines += [ "PREVIEWER" ] sources = [ "src/webview_mock.cpp" ] external_deps = [ "napi:cj_bind_ffi" ] } if (current_os == "ohos") { defines += [ "OHOS_PLATFORM" ] } if (current_os == "mingw") { defines += [ "WINDOWS_PLATFORM" ] } innerapi_tags = [ "platformsdk" ] part_name = "webview" subsystem_name = "web" }