123b3eb3cSopenharmony_ci# Copyright (c) 2021-2023 Huawei Device Co., Ltd. 223b3eb3cSopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License"); 323b3eb3cSopenharmony_ci# you may not use this file except in compliance with the License. 423b3eb3cSopenharmony_ci# You may obtain a copy of the License at 523b3eb3cSopenharmony_ci# 623b3eb3cSopenharmony_ci# http://www.apache.org/licenses/LICENSE-2.0 723b3eb3cSopenharmony_ci# 823b3eb3cSopenharmony_ci# Unless required by applicable law or agreed to in writing, software 923b3eb3cSopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS, 1023b3eb3cSopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1123b3eb3cSopenharmony_ci# See the License for the specific language governing permissions and 1223b3eb3cSopenharmony_ci# limitations under the License. 1323b3eb3cSopenharmony_ci 1423b3eb3cSopenharmony_ciimport("//build/ohos.gni") 1523b3eb3cSopenharmony_ciimport("//foundation/arkui/ace_engine/ace_config.gni") 1623b3eb3cSopenharmony_ci 1723b3eb3cSopenharmony_ciohos_source_set("utilsecurec_source") { 1823b3eb3cSopenharmony_ci subsystem_name = ace_engine_subsystem 1923b3eb3cSopenharmony_ci part_name = ace_engine_part 2023b3eb3cSopenharmony_ci if (defined(current_platform.name)) { 2123b3eb3cSopenharmony_ci platform = current_platform.name 2223b3eb3cSopenharmony_ci defines = [] 2323b3eb3cSopenharmony_ci config = { 2423b3eb3cSopenharmony_ci } 2523b3eb3cSopenharmony_ci if (defined(current_platform.config)) { 2623b3eb3cSopenharmony_ci config = current_platform.config 2723b3eb3cSopenharmony_ci } 2823b3eb3cSopenharmony_ci if (defined(config.defines)) { 2923b3eb3cSopenharmony_ci defines += config.defines 3023b3eb3cSopenharmony_ci } 3123b3eb3cSopenharmony_ci if (platform == "windows") { 3223b3eb3cSopenharmony_ci external_deps = [ "bounds_checking_function:libsec_shared" ] 3323b3eb3cSopenharmony_ci cflags = [ "-Wno-inconsistent-dllimport" ] 3423b3eb3cSopenharmony_ci } 3523b3eb3cSopenharmony_ci } 3623b3eb3cSopenharmony_ci} 3723b3eb3cSopenharmony_ci 3823b3eb3cSopenharmony_ciohos_source_set("preview_osal_source") { 3923b3eb3cSopenharmony_ci subsystem_name = ace_engine_subsystem 4023b3eb3cSopenharmony_ci part_name = ace_engine_part 4123b3eb3cSopenharmony_ci if (defined(current_platform.name)) { 4223b3eb3cSopenharmony_ci platform = current_platform.name 4323b3eb3cSopenharmony_ci defines = [] 4423b3eb3cSopenharmony_ci config = { 4523b3eb3cSopenharmony_ci } 4623b3eb3cSopenharmony_ci if (defined(current_platform.config)) { 4723b3eb3cSopenharmony_ci config = current_platform.config 4823b3eb3cSopenharmony_ci } 4923b3eb3cSopenharmony_ci if (defined(config.defines)) { 5023b3eb3cSopenharmony_ci defines += config.defines 5123b3eb3cSopenharmony_ci } 5223b3eb3cSopenharmony_ci 5323b3eb3cSopenharmony_ci sources = [ 5423b3eb3cSopenharmony_ci "${ace_root}/adapter/ohos/osal/log_wrapper.cpp", 5523b3eb3cSopenharmony_ci "ace_checker.cpp", 5623b3eb3cSopenharmony_ci "ace_engine_ext.cpp", 5723b3eb3cSopenharmony_ci "ace_trace.cpp", 5823b3eb3cSopenharmony_ci "advance/ai_write_adapter.cpp", 5923b3eb3cSopenharmony_ci "advance/data_detector_adapter.cpp", 6023b3eb3cSopenharmony_ci "advance/data_detector_mgr.cpp", 6123b3eb3cSopenharmony_ci "advance/image_analyzer_adapter_impl.cpp", 6223b3eb3cSopenharmony_ci "advance/image_analyzer_manager.cpp", 6323b3eb3cSopenharmony_ci "advance/image_analyzer_mgr.cpp", 6423b3eb3cSopenharmony_ci "app_bar_helper_impl.cpp", 6523b3eb3cSopenharmony_ci "display_info_utils.cpp", 6623b3eb3cSopenharmony_ci "download_manager_preview.cpp", 6723b3eb3cSopenharmony_ci "drawing_color_filter_preview.cpp", 6823b3eb3cSopenharmony_ci "drawing_lattice_preview.cpp", 6923b3eb3cSopenharmony_ci "event_report.cpp", 7023b3eb3cSopenharmony_ci "exception_handler.cpp", 7123b3eb3cSopenharmony_ci "fetch_manager.cpp", 7223b3eb3cSopenharmony_ci "file_uri_helper_preview.cpp", 7323b3eb3cSopenharmony_ci "frame_report.cpp", 7423b3eb3cSopenharmony_ci "image_packer_preview.cpp", 7523b3eb3cSopenharmony_ci "image_source_preview.cpp", 7623b3eb3cSopenharmony_ci "input_manager.cpp", 7723b3eb3cSopenharmony_ci "input_method_manager_preview.cpp", 7823b3eb3cSopenharmony_ci "modal_ui_extension_impl.cpp", 7923b3eb3cSopenharmony_ci "mouse_style_ohos.cpp", 8023b3eb3cSopenharmony_ci "package_event_proxy_preview.cpp", 8123b3eb3cSopenharmony_ci "pixel_map_preview.cpp", 8223b3eb3cSopenharmony_ci "response_data.cpp", 8323b3eb3cSopenharmony_ci "ressched_report.cpp", 8423b3eb3cSopenharmony_ci "socperf_client_impl.cpp", 8523b3eb3cSopenharmony_ci "stage_card_parser.cpp", 8623b3eb3cSopenharmony_ci "stylus_detector_default.cpp", 8723b3eb3cSopenharmony_ci "stylus_detector_loader.cpp", 8823b3eb3cSopenharmony_ci "stylus_detector_mgr.cpp", 8923b3eb3cSopenharmony_ci "system_bar_style_ohos.cpp", 9023b3eb3cSopenharmony_ci "system_properties.cpp", 9123b3eb3cSopenharmony_ci "task/task_runner_adapter_impl.cpp", 9223b3eb3cSopenharmony_ci "time_event_proxy_preview.cpp", 9323b3eb3cSopenharmony_ci "trace_id_impl.cpp", 9423b3eb3cSopenharmony_ci "view_data_wrap_impl.cpp", 9523b3eb3cSopenharmony_ci "want_wrap_preview.cpp", 9623b3eb3cSopenharmony_ci ] 9723b3eb3cSopenharmony_ci 9823b3eb3cSopenharmony_ci if (defined(resourceschedule_ffrt_support) && 9923b3eb3cSopenharmony_ci resourceschedule_ffrt_support) { 10023b3eb3cSopenharmony_ci sources += [ "long_frame_report_impl.cpp" ] 10123b3eb3cSopenharmony_ci } 10223b3eb3cSopenharmony_ci 10323b3eb3cSopenharmony_ci cflags_cc = [ 10423b3eb3cSopenharmony_ci "-DNAME_MAX=128", 10523b3eb3cSopenharmony_ci "-Wno-inconsistent-dllimport", 10623b3eb3cSopenharmony_ci ] 10723b3eb3cSopenharmony_ci 10823b3eb3cSopenharmony_ci deps = [ 10923b3eb3cSopenharmony_ci ":utilsecurec_source", 11023b3eb3cSopenharmony_ci "//foundation/graphic/graphic_2d/rosen/modules/platform:image_native", 11123b3eb3cSopenharmony_ci ] 11223b3eb3cSopenharmony_ci 11323b3eb3cSopenharmony_ci external_deps = [ 11423b3eb3cSopenharmony_ci "curl:curl_shared", 11523b3eb3cSopenharmony_ci "hilog:libhilog", 11623b3eb3cSopenharmony_ci ] 11723b3eb3cSopenharmony_ci 11823b3eb3cSopenharmony_ci if (ace_use_rosen_drawing) { 11923b3eb3cSopenharmony_ci external_deps += [ 12023b3eb3cSopenharmony_ci "graphic_2d:2d_graphics", 12123b3eb3cSopenharmony_ci "graphic_2d:drawing_napi_impl", 12223b3eb3cSopenharmony_ci ] 12323b3eb3cSopenharmony_ci } 12423b3eb3cSopenharmony_ci 12523b3eb3cSopenharmony_ci configs = [ "$ace_root:ace_config" ] 12623b3eb3cSopenharmony_ci 12723b3eb3cSopenharmony_ci if (is_ohos_standard_system) { 12823b3eb3cSopenharmony_ci sources += [ 12923b3eb3cSopenharmony_ci "${ace_root}/adapter/ohos/osal/resource_theme_style.cpp", 13023b3eb3cSopenharmony_ci "frame_trace_adapter_impl.cpp", 13123b3eb3cSopenharmony_ci "resource_adapter_impl_standard.cpp", 13223b3eb3cSopenharmony_ci "resource_convertor.cpp", 13323b3eb3cSopenharmony_ci ] 13423b3eb3cSopenharmony_ci defines += [ "OHOS_STANDARD_SYSTEM" ] 13523b3eb3cSopenharmony_ci if (platform == "windows") { 13623b3eb3cSopenharmony_ci deps += [ "//base/global/resource_management/frameworks/resmgr:global_resmgr_win" ] 13723b3eb3cSopenharmony_ci } else if (platform == "mac") { 13823b3eb3cSopenharmony_ci deps += [ "//base/global/resource_management/frameworks/resmgr:global_resmgr_mac" ] 13923b3eb3cSopenharmony_ci } else if (platform == "linux") { 14023b3eb3cSopenharmony_ci deps += [ "//base/global/resource_management/frameworks/resmgr:global_resmgr_linux" ] 14123b3eb3cSopenharmony_ci } 14223b3eb3cSopenharmony_ci external_deps += [ "napi:ace_napi" ] 14323b3eb3cSopenharmony_ci } else { 14423b3eb3cSopenharmony_ci sources += [ 14523b3eb3cSopenharmony_ci "frame_trace_adapter_impl.cpp", 14623b3eb3cSopenharmony_ci "resource_adapter_impl.cpp", 14723b3eb3cSopenharmony_ci ] 14823b3eb3cSopenharmony_ci include_dirs = [ "//prebuilts/ace-toolkit/preview/rich/include/resmgr/resourcemanager/include" ] 14923b3eb3cSopenharmony_ci if (platform == "windows") { 15023b3eb3cSopenharmony_ci defines += [ "NOGDI" ] 15123b3eb3cSopenharmony_ci libs = [ "//prebuilts/ace-toolkit/preview/rich/lib/windows/tv/libresourcemanager_win.lib" ] 15223b3eb3cSopenharmony_ci } else if (platform == "mac") { 15323b3eb3cSopenharmony_ci libs = [ "//prebuilts/ace-toolkit/preview/rich/lib/mac/tv/libresourcemanager_mac.dylib" ] 15423b3eb3cSopenharmony_ci } else if (platform == "linux") { 15523b3eb3cSopenharmony_ci libs = [ "//prebuilts/ace-toolkit/preview/rich/lib/linux/tv/libresourcemanager_linux.so" ] 15623b3eb3cSopenharmony_ci } 15723b3eb3cSopenharmony_ci } 15823b3eb3cSopenharmony_ci } 15923b3eb3cSopenharmony_ci} 160