Skip to content

Commit

Permalink
Build fixes for roll (flutter#135)
Browse files Browse the repository at this point in the history
* Add define for rendering

* Fix metal enum for older SDKs, add missing dep
  • Loading branch information
dnfield committed Apr 27, 2022
1 parent 43a7508 commit 3c9f0e1
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions impeller/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ config("impeller_public_config") {
defines += [ "IMPELLER_SUPPORTS_PLATFORM=1" ]
}

if (impeller_supports_rendering) {
defines += [ "IMPELLER_SUPPORTS_RENDERING=1" ]
}

if (is_win) {
defines += [ "_USE_MATH_DEFINES" ]
}
Expand Down
1 change: 1 addition & 0 deletions impeller/entity/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ impeller_component("entity_unittests") {

deps = [
":entity",
"../geometry:geometry_unittests",
"../playground",
]
}
12 changes: 12 additions & 0 deletions impeller/renderer/backend/metal/command_buffer_mtl.mm
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,18 @@
return CommandBufferMTL::Status::kError;
}

// TODO(dnfield): remove this declaration when we no longer need to build on
// machines with lower SDK versions than 11.0.s
#if !defined(MAC_OS_X_VERSION_11_0) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_11_0
typedef enum MTLCommandEncoderErrorState : NSInteger {
MTLCommandEncoderErrorStateUnknown = 0,
MTLCommandEncoderErrorStateCompleted = 1,
MTLCommandEncoderErrorStateAffected = 2,
MTLCommandEncoderErrorStatePending = 3,
MTLCommandEncoderErrorStateFaulted = 4,
} API_AVAILABLE(macos(11.0), ios(14.0));
#endif

API_AVAILABLE(ios(14.0), macos(11.0))
NSString* MTLCommandEncoderErrorStateToString(
MTLCommandEncoderErrorState state) {
Expand Down

0 comments on commit 3c9f0e1

Please sign in to comment.