Index: mojo/public/gles2/BUILD.gn |
diff --git a/mojo/public/gles2/BUILD.gn b/mojo/public/gles2/BUILD.gn |
index dc73e2635f3675439b2123c553b95ddec51b6d86..70e19b41fc8b89b92192fe33662b339fa9c18b9a 100644 |
--- a/mojo/public/gles2/BUILD.gn |
+++ b/mojo/public/gles2/BUILD.gn |
@@ -41,3 +41,29 @@ static_library("gles2") { |
} |
} |
+ |
+# In an is_component_build build, everything can link against //mojo/gles2 |
+# because it is built as a shared library. However, in a static build, |
+# //mojo/gles2 is linked into an executable (e.g., mojo_shell), and must be |
+# injected into other shared libraries (i.e., Mojo Apps) that need the mojo |
+# gles2 API. |
+# |
+# For component targets, add //mojo/public/gles2:for_component to your deps |
+# section. |
+# |
+# For shared_library targets (e.g., a Mojo App), add |
+# //mojo/public/gles2:for_shared_library to your deps |
+ |
+group("for_shared_library") { |
+ if (is_component_build) { |
+ deps = [ "//mojo/gles2" ] |
+ } else { |
+ deps = [ ":gles2" ] |
+ } |
+} |
+ |
+group("for_component") { |
+ if (is_component_build) { |
+ deps = [ "//mojo/gles2" ] |
+ } |
+} |