1# Copyright (c) 2021-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("//third_party/flutter/flutter_config.gni") 17 18# ------------------------------------------------ 19# Flutter engine config begin 20# ------------------------------------------------ 21config("flutter_config") { 22 visibility = [ ":*" ] 23 24 include_dirs = [ 25 "$flutter_root", 26 "$flutter_root/engine", 27 "$flutter_root/engine/flutter", 28 "$flutter_root/engine/flutter/third_party/txt/src", 29 ] 30 31 cflags = [ 32 "-fvisibility=hidden", 33 "-fdata-sections", 34 "-ffunction-sections", 35 "-Os", 36 ] 37 38 cflags_cc = [ 39 "-fvisibility-inlines-hidden", 40 "-Os", 41 ] 42 defines = [] 43 defines += ace_common_defines 44} 45 46template("flutter_engine") { 47 forward_variables_from(invoker, "*") 48 49 ohos_source_set(target_name) { 50 part_name = flutter_part 51 subsystem_name = flutter_subsystem 52 license_file = "$flutter_root/engine/flutter/LICENSE" 53 deps = [ 54 ":flutter_engine_asset_manager", 55 ":flutter_engine_common_$platform", 56 ":flutter_engine_flow_$platform", 57 ":flutter_engine_fml_$platform", 58 ":flutter_engine_lib_ui_$platform", 59 ":flutter_engine_shell_$platform", 60 "libtxt:thirdparty_lib_txt_$platform", 61 ] 62 public_configs = [ 63 ":flutter_config", 64 "icu:icu_config_$platform", 65 ] 66 } 67} 68 69foreach(item, ace_platforms) { 70 flutter_engine("third_party_flutter_engine_" + item.name) { 71 platform = item.name 72 } 73} 74 75# ------------------------------------------------ 76# Flutter engine config end 77# ------------------------------------------------ 78 79# ------------------------------------------------ 80# Flutter asset_manager config begin 81# ------------------------------------------------ 82ohos_source_set("flutter_engine_asset_manager") { 83 part_name = flutter_part 84 subsystem_name = flutter_subsystem 85 sources = [ 86 "$flutter_root/engine/flutter/assets/asset_manager.cc", 87 "$flutter_root/engine/flutter/assets/directory_asset_bundle.cc", 88 ] 89 90 configs = [ ":flutter_config" ] 91} 92 93# ------------------------------------------------ 94# Flutter asset_manager config end 95# ------------------------------------------------ 96 97# ------------------------------------------------ 98# Flutter fml config begin 99# ------------------------------------------------ 100config("flutter_engine_fml_mac_config") { 101 cflags = [ 102 "-Wno-thread-safety-attributes", 103 "-Wno-thread-safety-analysis", 104 ] 105} 106 107template("flutter_engine_fml") { 108 forward_variables_from(invoker, "*") 109 ohos_source_set(target_name) { 110 part_name = flutter_part 111 subsystem_name = flutter_subsystem 112 defines += invoker.defines 113 cflags_cc += invoker.cflags_cc 114 configs = [ 115 ":flutter_config", 116 "icu:icu_config_$platform", 117 ] 118 if (platform == "android") { 119 configs += [ "$ace_root/build:reduce_eh_frame_config" ] 120 } 121 122 sources = [ 123 "$flutter_root/engine/flutter/fml/base32.cc", 124 "$flutter_root/engine/flutter/fml/command_line.cc", 125 "$flutter_root/engine/flutter/fml/concurrent_message_loop.cc", 126 "$flutter_root/engine/flutter/fml/delayed_task.cc", 127 "$flutter_root/engine/flutter/fml/file.cc", 128 "$flutter_root/engine/flutter/fml/gpu_thread_merger.cc", 129 "$flutter_root/engine/flutter/fml/icu_util.cc", 130 "$flutter_root/engine/flutter/fml/log_settings.cc", 131 "$flutter_root/engine/flutter/fml/log_settings_state.cc", 132 "$flutter_root/engine/flutter/fml/logging.cc", 133 "$flutter_root/engine/flutter/fml/mapping.cc", 134 "$flutter_root/engine/flutter/fml/memory/weak_ptr_internal.cc", 135 "$flutter_root/engine/flutter/fml/message.cc", 136 "$flutter_root/engine/flutter/fml/message_loop.cc", 137 "$flutter_root/engine/flutter/fml/message_loop_impl.cc", 138 "$flutter_root/engine/flutter/fml/message_loop_task_queues.cc", 139 "$flutter_root/engine/flutter/fml/paths.cc", 140 "$flutter_root/engine/flutter/fml/synchronization/count_down_latch.cc", 141 "$flutter_root/engine/flutter/fml/synchronization/semaphore.cc", 142 "$flutter_root/engine/flutter/fml/synchronization/waitable_event.cc", 143 "$flutter_root/engine/flutter/fml/task_runner.cc", 144 "$flutter_root/engine/flutter/fml/thread.cc", 145 "$flutter_root/engine/flutter/fml/thread_local.cc", 146 "$flutter_root/engine/flutter/fml/time/time_point.cc", 147 "$flutter_root/engine/flutter/fml/trace_event.cc", 148 "$flutter_root/engine/flutter/fml/unique_fd.cc", 149 ] 150 151 if (platform == "windows") { 152 sources += [ 153 "$flutter_root/engine/flutter/fml/platform/win/errors_win.cc", 154 "$flutter_root/engine/flutter/fml/platform/win/file_win.cc", 155 "$flutter_root/engine/flutter/fml/platform/win/mapping_win.cc", 156 "$flutter_root/engine/flutter/fml/platform/win/message_loop_win.cc", 157 "$flutter_root/engine/flutter/fml/platform/win/native_library_win.cc", 158 "$flutter_root/engine/flutter/fml/platform/win/paths_win.cc", 159 ] 160 161 libs = [ "//prebuilts/mingw-w64/ohos/linux-x86_64/clang-mingw/x86_64-w64-mingw32/lib/librpcrt4.a" ] 162 } else if (platform == "mac" || platform == "ios") { 163 public_configs = [ ":flutter_engine_fml_mac_config" ] 164 165 cflags = [ "-DNS_FORMAT_ARGUMENT(A)=" ] 166 sources += [ 167 "$flutter_root/engine/flutter/fml/platform/darwin/cf_utils.cc", 168 "$flutter_root/engine/flutter/fml/platform/darwin/message_loop_darwin.mm", 169 "$flutter_root/engine/flutter/fml/platform/darwin/paths_darwin.mm", 170 "$flutter_root/engine/flutter/fml/platform/darwin/platform_version.mm", 171 "$flutter_root/engine/flutter/fml/platform/darwin/scoped_block.mm", 172 "$flutter_root/engine/flutter/fml/platform/darwin/scoped_nsobject.mm", 173 "$flutter_root/engine/flutter/fml/platform/darwin/string_range_sanitization.mm", 174 "$flutter_root/engine/flutter/fml/platform/posix/file_posix.cc", 175 "$flutter_root/engine/flutter/fml/platform/posix/mapping_posix.cc", 176 "$flutter_root/engine/flutter/fml/platform/posix/native_library_posix.cc", 177 "$flutter_root/engine/flutter/fml/platform/posix/paths_posix.cc", 178 "$flutter_root/engine/flutter/fml/platform/posix/shared_mutex_posix.cc", 179 ] 180 181 libs = [ 182 "CoreFoundation.framework", 183 "Foundation.framework", 184 ] 185 } else if (platform == "linux") { 186 sources += [ 187 "$flutter_root/engine/flutter/fml/platform/linux/message_loop_linux.cc", 188 "$flutter_root/engine/flutter/fml/platform/linux/paths_linux.cc", 189 "$flutter_root/engine/flutter/fml/platform/linux/timerfd.cc", 190 "$flutter_root/engine/flutter/fml/platform/posix/file_posix.cc", 191 "$flutter_root/engine/flutter/fml/platform/posix/mapping_posix.cc", 192 "$flutter_root/engine/flutter/fml/platform/posix/native_library_posix.cc", 193 "$flutter_root/engine/flutter/fml/platform/posix/paths_posix.cc", 194 ] 195 } else { 196 sources += [ 197 "$flutter_root/engine/flutter/fml/platform/linux/timerfd.cc", 198 "$flutter_root/engine/flutter/fml/platform/posix/file_posix.cc", 199 "$flutter_root/engine/flutter/fml/platform/posix/mapping_posix.cc", 200 "$flutter_root/engine/flutter/fml/platform/posix/native_library_posix.cc", 201 "$flutter_root/engine/flutter/fml/platform/posix/paths_posix.cc", 202 ] 203 204 if (is_standard_system) { 205 sources += [ 206 "$flutter_root/engine/flutter/fml/platform/linux/message_loop_linux.cc", 207 "$flutter_root/engine/flutter/fml/platform/linux/paths_linux.cc", 208 ] 209 external_deps = [ "hiviewdfx_hilog_native:libhilog" ] 210 } else { 211 sources += [ 212 "$flutter_root/engine/flutter/fml/platform/android/jni_util.cc", 213 "$flutter_root/engine/flutter/fml/platform/android/jni_weak_ref.cc", 214 "$flutter_root/engine/flutter/fml/platform/android/message_loop_android.cc", 215 "$flutter_root/engine/flutter/fml/platform/android/paths_android.cc", 216 "$flutter_root/engine/flutter/fml/platform/android/scoped_java_ref.cc", 217 ] 218 aosp_deps = [ 219 "shared_library:libandroid", 220 "shared_library:liblog", 221 ] 222 } 223 } 224 } 225} 226 227foreach(item, ace_platforms) { 228 flutter_engine_fml("flutter_engine_fml_" + item.name) { 229 platform = item.name 230 defines = [] 231 cflags_cc = [] 232 config = { 233 } 234 235 if (defined(item.config)) { 236 config = item.config 237 } 238 239 if (defined(config.defines)) { 240 defines = config.defines 241 } 242 243 if (defined(config.cflags_cc)) { 244 cflags_cc = config.cflags_cc 245 } 246 } 247} 248 249# ------------------------------------------------ 250# Flutter fml config end 251# ------------------------------------------------ 252 253# ------------------------------------------------ 254# Flutter common config begin 255# ------------------------------------------------ 256template("flutter_engine_common") { 257 forward_variables_from(invoker, "*") 258 259 ohos_source_set(target_name) { 260 part_name = flutter_part 261 subsystem_name = flutter_subsystem 262 defines += invoker.defines 263 cflags_cc += invoker.cflags_cc 264 configs = [ ":flutter_config" ] 265 if (platform == "android") { 266 configs += [ "$ace_root/build:reduce_eh_frame_config" ] 267 } 268 269 sources = [ 270 "$flutter_root/engine/flutter/common/settings.cc", 271 "$flutter_root/engine/flutter/common/task_runners.cc", 272 ] 273 274 deps = [ ":flutter_engine_fml_$platform" ] 275 } 276} 277 278foreach(item, ace_platforms) { 279 flutter_engine_common("flutter_engine_common_" + item.name) { 280 platform = item.name 281 defines = [] 282 cflags_cc = [] 283 config = { 284 } 285 286 if (defined(item.config)) { 287 config = item.config 288 } 289 290 if (defined(config.defines)) { 291 defines = config.defines 292 } 293 294 if (defined(config.cflags_cc)) { 295 cflags_cc = config.cflags_cc 296 } 297 } 298} 299 300# ------------------------------------------------ 301# Flutter common config end 302# ------------------------------------------------ 303 304# ------------------------------------------------ 305# Flutter flow config begin 306# ------------------------------------------------ 307template("flutter_engine_flow") { 308 forward_variables_from(invoker, "*") 309 310 ohos_source_set(target_name) { 311 part_name = flutter_part 312 subsystem_name = flutter_subsystem 313 defines += invoker.defines 314 cflags_cc += invoker.cflags_cc 315 316 configs = [ ":flutter_config" ] 317 if (platform == "android") { 318 configs += [ "$ace_root/build:reduce_eh_frame_config" ] 319 } 320 321 sources = [ 322 "$flutter_root/engine/flutter/flow/compositor_context.cc", 323 "$flutter_root/engine/flutter/flow/debug_print.cc", 324 "$flutter_root/engine/flutter/flow/embedded_views.cc", 325 "$flutter_root/engine/flutter/flow/instrumentation.cc", 326 "$flutter_root/engine/flutter/flow/layers/backdrop_filter_layer.cc", 327 "$flutter_root/engine/flutter/flow/layers/clip_path_layer.cc", 328 "$flutter_root/engine/flutter/flow/layers/clip_rect_layer.cc", 329 "$flutter_root/engine/flutter/flow/layers/clip_rrect_layer.cc", 330 "$flutter_root/engine/flutter/flow/layers/color_filter_layer.cc", 331 "$flutter_root/engine/flutter/flow/layers/container_layer.cc", 332 "$flutter_root/engine/flutter/flow/layers/filter_layer.cc", 333 "$flutter_root/engine/flutter/flow/layers/hole_layer.cc", 334 "$flutter_root/engine/flutter/flow/layers/layer.cc", 335 "$flutter_root/engine/flutter/flow/layers/layer_tree.cc", 336 "$flutter_root/engine/flutter/flow/layers/mask_layer.cc", 337 "$flutter_root/engine/flutter/flow/layers/opacity_layer.cc", 338 "$flutter_root/engine/flutter/flow/layers/performance_overlay_layer.cc", 339 "$flutter_root/engine/flutter/flow/layers/physical_shape_layer.cc", 340 "$flutter_root/engine/flutter/flow/layers/picture_layer.cc", 341 "$flutter_root/engine/flutter/flow/layers/platform_view_layer.cc", 342 "$flutter_root/engine/flutter/flow/layers/shader_mask_layer.cc", 343 "$flutter_root/engine/flutter/flow/layers/texture_layer.cc", 344 "$flutter_root/engine/flutter/flow/layers/transform_layer.cc", 345 "$flutter_root/engine/flutter/flow/matrix_decomposition.cc", 346 "$flutter_root/engine/flutter/flow/paint_utils.cc", 347 "$flutter_root/engine/flutter/flow/raster_cache.cc", 348 "$flutter_root/engine/flutter/flow/raster_cache_key.cc", 349 "$flutter_root/engine/flutter/flow/skia_gpu_object.cc", 350 "$flutter_root/engine/flutter/flow/texture.cc", 351 ] 352 353 deps = [ 354 ":flutter_engine_fml_$platform", 355 "skia:ace_skia_$platform", 356 ] 357 } 358} 359 360foreach(item, ace_platforms) { 361 flutter_engine_flow("flutter_engine_flow_" + item.name) { 362 platform = item.name 363 defines = [] 364 cflags_cc = [] 365 config = { 366 } 367 368 if (defined(item.config)) { 369 config = item.config 370 } 371 372 if (defined(config.defines)) { 373 defines = config.defines 374 } 375 376 if (defined(config.cflags_cc)) { 377 cflags_cc = config.cflags_cc 378 } 379 } 380} 381 382# ------------------------------------------------ 383# Flutter flow config end 384# ------------------------------------------------ 385 386# ------------------------------------------------ 387# Flutter shell config begin 388# ------------------------------------------------ 389template("flutter_engine_shell") { 390 forward_variables_from(invoker, "*") 391 392 ohos_source_set(target_name) { 393 part_name = flutter_part 394 subsystem_name = flutter_subsystem 395 defines += invoker.defines 396 defines += [ 397 "FLUTTER_ENGINE_VERSION=\"cc88fa45dbf4c55bc23cecea17fb90f43bccf588\"", 398 "SKIA_VERSION=\"4b567cd679ab964b5f6281a67a96c694c950f597\"", 399 "DART_VERSION=\"fake version\"", 400 ] 401 cflags_cc += invoker.cflags_cc 402 403 configs = [ 404 ":flutter_config", 405 "icu:icu_config_$platform", 406 ] 407 if (platform == "android") { 408 configs += [ "$ace_root/build:reduce_eh_frame_config" ] 409 } 410 411 sources = [ 412 "$flutter_root/engine/flutter/shell/common/animator.cc", 413 "$flutter_root/engine/flutter/shell/common/persistent_cache.cc", 414 "$flutter_root/engine/flutter/shell/common/pipeline.cc", 415 "$flutter_root/engine/flutter/shell/common/rasterizer.cc", 416 "$flutter_root/engine/flutter/shell/common/shell_io_manager.cc", 417 "$flutter_root/engine/flutter/shell/common/surface.cc", 418 "$flutter_root/engine/flutter/shell/common/thread_host.cc", 419 "$flutter_root/engine/flutter/shell/common/vsync_waiter.cc", 420 "$flutter_root/engine/flutter/shell/common/vsync_waiter_fallback.cc", 421 422 # only support gl and software 423 "$flutter_root/engine/flutter/shell/gpu/gpu_surface_gl.cc", 424 "$flutter_root/engine/flutter/shell/gpu/gpu_surface_gl_delegate.cc", 425 "$flutter_root/engine/flutter/shell/gpu/gpu_surface_software.cc", 426 "$flutter_root/engine/flutter/shell/gpu/gpu_surface_software_delegate.cc", 427 "$flutter_root/engine/flutter/shell/version/version.cc", 428 429 # Ability Cross-platform Environment(ACE) override implementation 430 "$flutter_root/engine/flutter/runtime/ace_runtime_controller.cc", 431 "$flutter_root/engine/flutter/runtime/window_manager.cc", 432 "$flutter_root/engine/flutter/shell/common/ace_engine.cc", 433 "$flutter_root/engine/flutter/shell/common/ace_platform_view.cc", 434 "$flutter_root/engine/flutter/shell/common/ace_run_configuration.cc", 435 "$flutter_root/engine/flutter/shell/common/ace_shell.cc", 436 ] 437 438 if (defined(config.disable_gpu) && config.disable_gpu) { 439 sources -= [ "$flutter_root/engine/flutter/shell/gpu/gpu_surface_gl.cc" ] 440 } 441 442 deps = [ 443 ":flutter_engine_fml_$platform", 444 "skia:ace_skia_$platform", 445 ] 446 447 if (is_standard_system && platform == "ohos") { 448 include_dirs = [ 449 "//foundation/window/window_manager/interfaces/innerkits", 450 "//commonlibrary/c_utils/base/include", 451 ] 452 sources += [ 453 "$flutter_root/engine/flutter/shell/platform/ohos/ace_vsync_waiter_embedder.cc", 454 "$flutter_root/engine/flutter/shell/platform/ohos/ohos_shell_holder.cc", 455 "$flutter_root/engine/flutter/shell/platform/ohos/ohos_surface_software.cc", 456 "$flutter_root/engine/flutter/shell/platform/ohos/platform_task_runner.cc", 457 "$flutter_root/engine/flutter/shell/platform/ohos/platform_task_runner_adapter.cc", 458 "$flutter_root/engine/flutter/shell/platform/ohos/platform_view_ohos.cc", 459 ] 460 if ((!defined(config.disable_gpu) || !config.disable_gpu) && (!defined( 461 config.enable_rosen_backend) || !config.enable_rosen_backend)) { 462 sources += [ 463 "$flutter_root/engine/flutter/shell/platform/ohos/ohos_surface_gl.cc", 464 ] 465 466 public_deps = [ "//foundation/graphic/graphic_2d:libgl" ] 467 } 468 deps += [ 469 "//foundation/graphic/graphic_2d/rosen/modules/composer:libcomposer", 470 "//foundation/graphic/graphic_2d/rosen/modules/render_service_client:librender_service_client", 471 "//foundation/window/window_manager/wm:libwm", 472 ] 473 external_deps = [ 474 "eventhandler:libeventhandler", 475 "ipc:ipc_core", 476 ] 477 } else if (platform == "ohos" || platform == "android") { 478 sources += [ 479 # Ability Cross-platform Environment(ACE) override implementation 480 "$flutter_root/engine/flutter/shell/common/ace_display_manager_jni.cc", 481 "$flutter_root/engine/flutter/shell/platform/android/ace_platform_view_android.cc", 482 "$flutter_root/engine/flutter/shell/platform/android/ace_vsync_waiter_android.cc", 483 "$flutter_root/engine/flutter/shell/platform/android/android_context_gl.cc", 484 "$flutter_root/engine/flutter/shell/platform/android/android_environment_gl.cc", 485 "$flutter_root/engine/flutter/shell/platform/android/android_external_texture_gl.cc", 486 "$flutter_root/engine/flutter/shell/platform/android/android_native_window.cc", 487 "$flutter_root/engine/flutter/shell/platform/android/android_shell_holder.cc", 488 "$flutter_root/engine/flutter/shell/platform/android/android_surface.cc", 489 "$flutter_root/engine/flutter/shell/platform/android/android_surface_gl.cc", 490 "$flutter_root/engine/flutter/shell/platform/android/android_surface_software.cc", 491 "$flutter_root/engine/flutter/shell/platform/android/apk_asset_provider.cc", 492 "$flutter_root/engine/flutter/shell/platform/android/platform_message_response_android.cc", 493 ] 494 495 aosp_deps = [ 496 "shared_library:libEGL", 497 "shared_library:libGLESv2", 498 ] 499 500 if (defined(config.use_agp_vsync) && config.use_agp_vsync) { 501 sources += [ "$flutter_root/engine/flutter/shell/platform/ohos/ace_vsync_waiter_embedder.cc" ] 502 external_deps = [ 503 "graphic:libagp", 504 "graphic:libagpcoreui", 505 "graphic:libagpcoreui_adapter", 506 "graphic:libagpwindow", 507 ] 508 } 509 } else if (platform == "ios") { 510 ios_prefix = "$flutter_root/engine/flutter/shell/platform/darwin/ios" 511 include_dirs = [ 512 "$ios_prefix", 513 "$ios_prefix/framework/Headers", 514 "$flutter_root/engine/flutter/shell/platform/darwin/common/framework/Headers", 515 ] 516 517 _flutter_framework_headers = [ 518 "$ios_prefix/framework/Headers/Flutter.h", 519 "$ios_prefix/framework/Headers/FlutterAppDelegate.h", 520 "$ios_prefix/framework/Headers/FlutterDartProject.h", 521 "$ios_prefix/framework/Headers/FlutterEngine.h", 522 "$ios_prefix/framework/Headers/FlutterHeadlessDartRunner.h", 523 "$ios_prefix/framework/Headers/FlutterPlatformViews.h", 524 "$ios_prefix/framework/Headers/FlutterPlugin.h", 525 "$ios_prefix/framework/Headers/FlutterPluginAppLifeCycleDelegate.h", 526 "$ios_prefix/framework/Headers/FlutterTexture.h", 527 "$ios_prefix/framework/Headers/FlutterViewController.h", 528 ] 529 530 _flutter_shell_ios = [ 531 "$flutter_root/engine/flutter/shell/platform/darwin/common/buffer_conversions.mm", 532 "$flutter_root/engine/flutter/shell/platform/darwin/common/command_line.mm", 533 "$flutter_root/engine/flutter/shell/common/switches.cc", 534 "$flutter_root/engine/flutter/shell/common/switches.h", 535 "$ios_prefix/framework/Source/FlutterAppDelegate.mm", 536 "$ios_prefix/framework/Source/FlutterAppDelegate_Internal.h", 537 "$ios_prefix/framework/Source/FlutterBinaryMessengerRelay.mm", 538 "$ios_prefix/framework/Source/FlutterDartProject.mm", 539 "$ios_prefix/framework/Source/FlutterDartProject_Internal.h", 540 "$ios_prefix/framework/Source/FlutterEngine.mm", 541 "$ios_prefix/framework/Source/FlutterEngine_Internal.h", 542 "$ios_prefix/framework/Source/FlutterHeadlessDartRunner.mm", 543 "$ios_prefix/framework/Source/FlutterOverlayView.h", 544 "$ios_prefix/framework/Source/FlutterOverlayView.mm", 545 "$ios_prefix/framework/Source/FlutterPlatformPlugin.h", 546 "$ios_prefix/framework/Source/FlutterPlatformPlugin.mm", 547 "$ios_prefix/framework/Source/FlutterPlatformViews.mm", 548 "$ios_prefix/framework/Source/FlutterPlatformViews_Internal.h", 549 "$ios_prefix/framework/Source/FlutterPlatformViews_Internal.mm", 550 "$ios_prefix/framework/Source/FlutterPluginAppLifeCycleDelegate.mm", 551 "$ios_prefix/framework/Source/FlutterTextInputDelegate.h", 552 "$ios_prefix/framework/Source/FlutterView.h", 553 "$ios_prefix/framework/Source/FlutterView.mm", 554 "$ios_prefix/framework/Source/FlutterViewController.mm", 555 "$ios_prefix/framework/Source/FlutterViewController_Internal.h", 556 "$ios_prefix/framework/Source/platform_message_response_darwin.h", 557 "$ios_prefix/framework/Source/platform_message_response_darwin.mm", 558 "$ios_prefix/framework/Source/platform_message_router.h", 559 "$ios_prefix/framework/Source/platform_message_router.mm", 560 "$ios_prefix/framework/Source/vsync_waiter_ios.h", 561 "$ios_prefix/framework/Source/vsync_waiter_ios.mm", 562 "$ios_prefix/ios_external_texture_gl.h", 563 "$ios_prefix/ios_external_texture_gl.mm", 564 "$ios_prefix/ios_gl_context.h", 565 "$ios_prefix/ios_gl_context.mm", 566 "$ios_prefix/ios_gl_render_target.h", 567 "$ios_prefix/ios_gl_render_target.mm", 568 "$ios_prefix/ios_surface.h", 569 "$ios_prefix/ios_surface.mm", 570 "$ios_prefix/ios_surface_gl.h", 571 "$ios_prefix/ios_surface_gl.mm", 572 "$ios_prefix/ios_surface_software.h", 573 "$ios_prefix/ios_surface_software.mm", 574 "$ios_prefix/platform_view_ios.h", 575 "$ios_prefix/platform_view_ios.mm", 576 ] 577 578 sources += _flutter_framework_headers 579 sources += _flutter_shell_ios 580 581 defines += [ 582 "FLUTTER_FRAMEWORK=1", 583 "FLUTTER_RUNTIME_MODE=3", 584 ] 585 586 libs = [ 587 "CoreMedia.framework", 588 "CoreVideo.framework", 589 "UIKit.framework", 590 "OpenGLES.framework", 591 "AudioToolbox.framework", 592 "QuartzCore.framework", 593 ] 594 } 595 } 596} 597 598foreach(item, ace_platforms) { 599 flutter_engine_shell("flutter_engine_shell_" + item.name) { 600 platform = item.name 601 defines = [] 602 cflags_cc = [] 603 config = { 604 } 605 606 if (defined(item.config)) { 607 config = item.config 608 } 609 610 if (defined(config.defines)) { 611 defines = config.defines 612 } 613 614 if (defined(config.cflags_cc)) { 615 cflags_cc = config.cflags_cc 616 } 617 } 618} 619 620# ------------------------------------------------ 621# Flutter shell config end 622# ------------------------------------------------ 623 624# ------------------------------------------------ 625# Flutter lib_ui config begin 626# ------------------------------------------------ 627template("flutter_engine_lib_ui") { 628 forward_variables_from(invoker, "*") 629 ohos_source_set(target_name) { 630 part_name = flutter_part 631 subsystem_name = flutter_subsystem 632 defines += invoker.defines 633 cflags_cc += invoker.cflags_cc 634 635 configs = [ 636 ":flutter_config", 637 "icu:icu_config_$platform", 638 ] 639 if (platform == "android") { 640 configs += [ "$ace_root/build:reduce_eh_frame_config" ] 641 } 642 643 sources = [ 644 "$flutter_root/engine/flutter/lib/ui/compositing/scene.cc", 645 "$flutter_root/engine/flutter/lib/ui/compositing/scene_builder.cc", 646 "$flutter_root/engine/flutter/lib/ui/painting/canvas.cc", 647 "$flutter_root/engine/flutter/lib/ui/painting/color_filter.cc", 648 "$flutter_root/engine/flutter/lib/ui/painting/engine_layer.cc", 649 "$flutter_root/engine/flutter/lib/ui/painting/gradient.cc", 650 "$flutter_root/engine/flutter/lib/ui/painting/image.cc", 651 "$flutter_root/engine/flutter/lib/ui/painting/image_filter.cc", 652 "$flutter_root/engine/flutter/lib/ui/painting/matrix.cc", 653 "$flutter_root/engine/flutter/lib/ui/painting/path.cc", 654 "$flutter_root/engine/flutter/lib/ui/painting/picture_recorder.cc", 655 "$flutter_root/engine/flutter/lib/ui/painting/shader.cc", 656 "$flutter_root/engine/flutter/lib/ui/painting/vertices.cc", 657 "$flutter_root/engine/flutter/lib/ui/window/platform_message.cc", 658 "$flutter_root/engine/flutter/lib/ui/window/platform_message_response.cc", 659 "$flutter_root/engine/flutter/lib/ui/window/pointer_data_packet.cc", 660 "$flutter_root/engine/flutter/lib/ui/window/viewport_metrics.cc", 661 662 # Ability Cross-platform Environment(ACE) override implementation 663 "$flutter_root/engine/flutter/lib/ui/painting/image_encoding.cc", 664 "$flutter_root/engine/flutter/lib/ui/painting/paint.cc", 665 "$flutter_root/engine/flutter/lib/ui/painting/picture.cc", 666 "$flutter_root/engine/flutter/lib/ui/text/font_collection.cc", 667 "$flutter_root/engine/flutter/lib/ui/text/text_box.cc", 668 "$flutter_root/engine/flutter/lib/ui/ui_dart_state.cc", 669 "$flutter_root/engine/flutter/lib/ui/window/window.cc", 670 ] 671 672 if (platform == "mac" || platform == "windows" || platform == "ios" || 673 platform == "linux") { 674 sources += 675 [ "$flutter_root/engine/flutter/lib/ui/window/pointer_data.cc" ] 676 } 677 678 deps = [ 679 ":flutter_engine_fml_$platform", 680 "skia:ace_skia_$platform", 681 ] 682 } 683} 684 685foreach(item, ace_platforms) { 686 flutter_engine_lib_ui("flutter_engine_lib_ui_" + item.name) { 687 platform = item.name 688 defines = [] 689 cflags_cc = [] 690 config = { 691 } 692 693 if (defined(item.config)) { 694 config = item.config 695 } 696 697 if (defined(config.defines)) { 698 defines = config.defines 699 } 700 701 if (defined(config.cflags_cc)) { 702 cflags_cc = config.cflags_cc 703 } 704 } 705} 706# ------------------------------------------------ 707# Flutter lib_ui config end 708# ------------------------------------------------ 709