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("//foundation/arkui/ace_engine/ace_config.gni") 16import( 17 "//foundation/arkui/ace_engine/adapter/preview/build/config_js_engine.gni") 18import("//foundation/arkui/ace_engine/interfaces/napi/kits/napi_lib.gni") 19 20config("bridge_config") { 21 cflags_cc = [ 22 "-std=c++17", 23 "-Wno-c99-designator", 24 "-Wno-unknown-warning-option", 25 ] 26 include_dirs = [ 27 "$ace_root", 28 "$ace_root/frameworks", 29 "$flutter_root/engine", 30 "$flutter_root/engine/flutter/shell/platform/common/cpp/public", 31 "$flutter_root/engine/ace_adapter/flutter/shell/platform/glfw/public", 32 ] 33} 34 35if (use_mac) { 36 platform = "mac" 37} else if (use_linux) { 38 platform = "linux" 39} else { 40 platform = "windows" 41} 42platform_defines = [] 43foreach(item, ace_platforms) { 44 if (platform == item.name) { 45 if (defined(item.config)) { 46 platform_config = item.config 47 if (defined(platform_config.defines)) { 48 platform_defines = platform_config.defines 49 } 50 } 51 } 52} 53 54ohos_shared_library("test_bridge") { 55 configs = [ ":bridge_config" ] 56 defines = platform_defines 57 sources = [ 58 "run_args_parser.cpp", 59 "test_bridge.cpp", 60 ] 61 62 deps = [ "$ace_napi:ace_napi" ] 63 64 if (use_mingw_win) { 65 deps += [ "$ace_root/adapter/preview/build:libace_engine_windows" ] 66 libs = [ "pthread" ] 67 } else if (use_mac) { 68 deps += [ "$ace_root/adapter/preview/build:libace_engine_mac" ] 69 } else if (use_linux) { 70 deps += [ "$ace_root/adapter/preview/build:libace_engine_linux" ] 71 } 72} 73