From 5734f9a52f933e421e2a55d7a16244b0a2526343 Mon Sep 17 00:00:00 2001 From: Chris Yang Date: Fri, 25 Aug 2023 10:31:30 -0700 Subject: [PATCH] Ignore unguarded-availability for unit test (flutter/engine#44852) Ignore ungarded-availability for unit test fixes https://github.com/flutter/flutter/issues/128958 [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style --- .../src/flutter/shell/platform/darwin/ios/BUILD.gn | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/engine/src/flutter/shell/platform/darwin/ios/BUILD.gn b/engine/src/flutter/shell/platform/darwin/ios/BUILD.gn index b6b1799365..8aa967ae6c 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/BUILD.gn +++ b/engine/src/flutter/shell/platform/darwin/ios/BUILD.gn @@ -227,6 +227,12 @@ source_set("ios_test_flutter_mrc") { "-F$platform_frameworks_path", "-mios-simulator-version-min=$ios_testing_deployment_target", ] + + # XCode 15 beta has a bug where iOS 17 API usage is not guarded. + # This bug results engine build failure since the engine treats warnings as errors. + # The `-Wno-unguarded-availability-new` can be removed when the XCode bug is fixed. + # See details in https://github.com/flutter/flutter/issues/128958. + cflags_objcc = [ "-Wno-unguarded-availability-new" ] sources = [ "framework/Source/FlutterEnginePlatformViewTest.mm", "framework/Source/FlutterEngineTest_mrc.mm", @@ -271,6 +277,12 @@ shared_library("ios_test_flutter") { "-fobjc-arc", "-mios-simulator-version-min=$ios_testing_deployment_target", ] + + # XCode 15 beta has a bug where iOS 17 API usage is not guarded. + # This bug results engine build failure since the engine treats warnings as errors. + # The `-Wno-unguarded-availability-new` can be removed when the XCode bug is fixed. + # See details in https://github.com/flutter/flutter/issues/128958. + cflags_objcc = [ "-Wno-unguarded-availability-new" ] ldflags = [ "-F$platform_frameworks_path", "-Wl,-install_name,@rpath/Frameworks/libios_test_flutter.dylib",