Skip to content

Commit 597c10e

Browse files
chinmaygardednfield
authored andcommitted
Fix diagnostic on iOS simulators. (flutter#71)
1 parent f3a6b3e commit 597c10e

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

impeller/renderer/backend/metal/surface_mtl.h

+7
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ namespace impeller {
1414

1515
class SurfaceMTL final : public Surface {
1616
public:
17+
#pragma GCC diagnostic push
18+
// Disable the diagnostic for iOS Simulators. Metal without emulation isn't
19+
// available prior to iOS 13 and that's what the simulator headers say when
20+
// support for CAMetalLayer begins. CAMetalLayer is available on iOS 8.0 and
21+
// above which is well below Flutters support level.
22+
#pragma GCC diagnostic ignored "-Wunguarded-availability-new"
1723
//----------------------------------------------------------------------------
1824
/// @brief Wraps the current drawable of the given Metal layer to create
1925
/// a surface Impeller can render to. The surface must be created
@@ -29,6 +35,7 @@ class SurfaceMTL final : public Surface {
2935
static std::unique_ptr<Surface> WrapCurrentMetalLayerDrawable(
3036
std::shared_ptr<Context> context,
3137
CAMetalLayer* layer);
38+
#pragma GCC diagnostic pop
3239

3340
// |Surface|
3441
~SurfaceMTL() override;

impeller/renderer/backend/metal/surface_mtl.mm

+4
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212

1313
namespace impeller {
1414

15+
#pragma GCC diagnostic push
16+
#pragma GCC diagnostic ignored "-Wunguarded-availability-new"
17+
1518
std::unique_ptr<Surface> SurfaceMTL::WrapCurrentMetalLayerDrawable(
1619
std::shared_ptr<Context> context,
1720
CAMetalLayer* layer) {
@@ -114,5 +117,6 @@
114117
[drawable_ present];
115118
return true;
116119
}
120+
#pragma GCC diagnostic pop
117121

118122
} // namespace impeller

0 commit comments

Comments
 (0)