Metal.framework must be optional instead of hard requirement.
It's required to execute binary on Mac 10.10.
Problem has been revealed after integrating 1002023.
It's not visible by default,
because clang under the hood changes hard requirement to optional.
See:
- https://chromium-review.googlesource.com/c/chromium/src/+/1792702
- https://bugs.chromium.org/p/chromium/issues/detail?id=1003381 discussion.
Bug: chromium:1003381
Change-Id: I46e8da1092748256985ca4c2b90244f2ac5d422c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12540
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
diff --git a/BUILD.gn b/BUILD.gn
index 1fd4a9d..abc86d6 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -56,6 +56,15 @@
}
}
+config("libdawn_native_weak_framework") {
+ if (is_mac && dawn_enable_metal) {
+ ldflags = [
+ "-weak_framework",
+ "Metal",
+ ]
+ }
+}
+
dawn_json_generator("libdawn_native_utils_gen") {
target = "dawn_native_utils"
outputs = [
@@ -119,6 +128,7 @@
]
configs += [ ":libdawn_native_internal" ]
+ all_dependent_configs = [ ":libdawn_native_weak_framework" ]
libs = []
# Dependencies that are needed to compile libdawn_native entry points in
@@ -307,7 +317,6 @@
if (dawn_enable_metal) {
libs += [
- "Metal.framework",
"Cocoa.framework",
"IOKit.framework",
"IOSurface.framework",