Skip to content

Commit

Permalink
Allow building targets that do not create metal shaders on all platfo…
Browse files Browse the repository at this point in the history
…rms. (flutter#133)
  • Loading branch information
dnfield committed Apr 27, 2022
1 parent 1a055b0 commit 3bc1f33
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
4 changes: 4 additions & 0 deletions impeller/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -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") {
Expand Down
10 changes: 8 additions & 2 deletions impeller/tessellator/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
7 changes: 5 additions & 2 deletions impeller/tools/impeller.gni
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

# ------------------------------------------------------------------------------
Expand Down Expand Up @@ -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, "*")
}
Expand Down

0 comments on commit 3bc1f33

Please sign in to comment.