From e96ad6e4219413b8bc1c7e5af5ca0d15920a89dd Mon Sep 17 00:00:00 2001 From: Kaushik Iska Date: Mon, 29 Mar 2021 15:59:03 -0500 Subject: [PATCH] [ios] [asan] Copy asan runtime dylib when built with "--asan" (flutter/engine#25284) --- .../shell/platform/darwin/ios/BUILD.gn | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/engine/src/flutter/shell/platform/darwin/ios/BUILD.gn b/engine/src/flutter/shell/platform/darwin/ios/BUILD.gn index 4402d1d136..7ae1e975d3 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/BUILD.gn +++ b/engine/src/flutter/shell/platform/darwin/ios/BUILD.gn @@ -271,6 +271,24 @@ copy("copy_dylib") { deps = [ ":create_flutter_framework_dylib" ] } +copy("copy_asan_runtime_dylib") { + visibility = [ ":*" ] + + _libclang_base_path = + "//buildtools/mac-x64/clang/lib/clang/13.0.0/lib/darwin/" + + if (defined(use_ios_simulator) && use_ios_simulator) { + _dylib_name = "libclang_rt.asan_iossim_dynamic.dylib" + } else { + _dylib_name = "libclang_rt.asan_ios_dynamic.dylib" + } + + sources = [ "$_libclang_base_path/$_dylib_name" ] + outputs = [ "$root_out_dir/$_dylib_name" ] + + deps = [ ":create_flutter_framework_dylib" ] +} + action("copy_framework_info_plist") { script = "//flutter/build/copy_info_plist.py" visibility = [ ":*" ] @@ -352,6 +370,10 @@ group("universal_flutter_framework") { ":copy_framework_podspec", ":copy_license", ] + + if (is_asan) { + deps += [ ":copy_asan_runtime_dylib" ] + } } action("flutter_framework") {