Allow building targets that do not create metal shaders on all platforms. (flutter/engine#133)

This commit is contained in:
Dan Field
2022-04-13 13:04:13 -07:00
committed by Dan Field
parent b09c8eb436
commit 3ca787ddae
3 changed files with 17 additions and 4 deletions

View File

@@ -12,6 +12,10 @@ config("impeller_public_config") {
if (impeller_supports_platform) {
defines += [ "IMPELLER_SUPPORTS_PLATFORM=1" ]
}
if (is_win) {
defines += [ "_USE_MATH_DEFINES" ]
}
}
group("impeller") {

View File

@@ -15,8 +15,14 @@ impeller_component("tessellator") {
deps = [ "//third_party/libtess2" ]
}
shared_library("tessellator_shared") {
output_name = "tessellator"
impeller_component("tessellator_shared") {
target_type = "shared_library"
if (is_win) {
output_name = "libtessellator"
} else {
output_name = "tessellator"
}
sources = [
"c/tessellator.h",

View File

@@ -10,7 +10,10 @@ declare_args() {
impeller_enable_playground = false
# Whether Impeller is supported on the platform.
impeller_supports_platform = is_mac || is_ios
impeller_supports_platform = true
# Whether Impeller shaders are supported on the platform.
impeller_shaders_supports_platform = is_mac || is_ios
}
# ------------------------------------------------------------------------------
@@ -289,7 +292,7 @@ template("impeller_shaders_real") {
# @see impeller_shaders_real
#
template("impeller_shaders") {
if (impeller_supports_platform) {
if (impeller_shaders_supports_platform) {
impeller_shaders_real(target_name) {
forward_variables_from(invoker, "*")
}