Build fixes for roll (flutter/engine#135)

* Add define for rendering

* Fix metal enum for older SDKs, add missing dep
This commit is contained in:
Dan Field 2022-04-13 16:33:26 -07:00 committed by Dan Field
parent 7a8c2a90e7
commit 3ff34b1e73
3 changed files with 17 additions and 0 deletions

View File

@ -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" ]
}

View File

@ -87,6 +87,7 @@ impeller_component("entity_unittests") {
deps = [
":entity",
"../geometry:geometry_unittests",
"../playground",
]
}

View File

@ -53,6 +53,18 @@ static CommandBuffer::Status ToCommitResult(MTLCommandBufferStatus status) {
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) {