1# Copyright (c) 2021-2023 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") 16 17ohos_source_set("preview_entrance_source") { 18 subsystem_name = ace_engine_subsystem 19 part_name = ace_engine_part 20 if (defined(current_platform.name)) { 21 platform = current_platform.name 22 defines = [] 23 cflags_cc = [] 24 config = { 25 } 26 if (defined(current_platform.config)) { 27 config = current_platform.config 28 } 29 if (defined(config.defines)) { 30 defines += config.defines 31 } 32 if (defined(config.cflags_cc)) { 33 cflags_cc += config.cflags_cc 34 } 35 configs = [ "$ace_root:ace_config" ] 36 37 # set icu_data_path for ark preview 38 defines += [ "INIT_ICU_DATA_PATH" ] 39 40 sources = [ 41 "$ace_root/adapter/ohos/entrance/ace_new_pipe_judgement.cpp", 42 "ace_ability.cpp", 43 "ace_application_info.cpp", 44 "ace_container.cpp", 45 "ace_resource_register.cpp", 46 "clipboard/clipboard_impl.cpp", 47 "clipboard/clipboard_proxy_impl.cpp", 48 "editing/text_input_client_mgr.cpp", 49 "editing/text_input_connection_impl.cpp", 50 "editing/text_input_impl.cpp", 51 "event_dispatcher.cpp", 52 "flutter_ace_view.cpp", 53 "subwindow_preview.cpp", 54 ] 55 56 deps = [ 57 "$ace_flutter_engine_root/glfw:flutter_glfw_preview_$platform", 58 "$ace_flutter_engine_root/skia:ace_skia_$platform", 59 "$ace_napi:ace_napi", 60 "$ace_root/frameworks/core/components/theme:build_theme_code", 61 ] 62 63 if (defined(config.enable_rosen_backend) && config.enable_rosen_backend) { 64 sources -= [ "flutter_ace_view.cpp" ] 65 sources += [ "rs_ace_view.cpp" ] 66 deps += [ "//foundation/graphic/graphic_2d/rosen/modules/render_service_client:librender_service_client" ] 67 } 68 69 if (!is_cross_platform_build) { 70 if (platform == "windows") { 71 defines -= [ "UNICODE" ] 72 deps += [ "//base/global/resource_management/frameworks/resmgr:global_resmgr_win" ] 73 cflags_cc += [ "-DNONLS" ] 74 } 75 76 if (platform == "mac") { 77 deps += [ "//base/global/resource_management/frameworks/resmgr:global_resmgr_mac" ] 78 } 79 80 if (platform == "linux") { 81 deps += [ "//base/global/resource_management/frameworks/resmgr:global_resmgr_linux" ] 82 } 83 } 84 } 85} 86