Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(651)

Unified Diff: mojo/public/c/system/BUILD.gn

Issue 2047813003: Revert of Mojo: Eliminate duplicate C API symbols (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/mojo_variables.gypi ('k') | mojo/public/c/system/set_thunks_for_app.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/c/system/BUILD.gn
diff --git a/mojo/public/c/system/BUILD.gn b/mojo/public/c/system/BUILD.gn
index 5d7085decdd849dc012bee707e438dc6a60fd243..c876027690c64e8788c44f9c160cbe4864e1d3a8 100644
--- a/mojo/public/c/system/BUILD.gn
+++ b/mojo/public/c/system/BUILD.gn
@@ -2,7 +2,11 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-component("system") {
+# Depend on this target to use the types etc defined in the system without
+# linking against a specific implementation of the system. To link against a
+# particular implementation, use the :for_component or
+# :for_shared_library targets, depending on the type of target you are.
+source_set("system") {
sources = [
"buffer.h",
"core.h",
@@ -12,38 +16,45 @@
"message_pipe.h",
"platform_handle.h",
"system_export.h",
- "thunks.cc",
- "thunks.h",
"types.h",
"wait_set.h",
]
-
- defines = [ "MOJO_SYSTEM_IMPLEMENTATION" ]
}
-# This should ONLY be depended upon directly by shared_library targets which
-# need to export the MojoSetSystemThunks symbol, like targets generated by the
-# mojo_native_application template in //mojo/public/mojo_application.gni.
-source_set("set_thunks_for_app") {
- sources = [
- "set_thunks_for_app.cc",
- ]
-
- public_deps = [
- ":system",
- ]
-}
-
-# TODO(rockot): Delete these deprecated aliases.
+# In an is_component_build build, everything can link against //mojo/edk/system
+# because it is built as a shared library. However, in a static build,
+# //mojo/edk/system 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
+# system API.
+#
+# For component targets, add //mojo/public/c/system:for_component to your deps
+# section.
+#
+# For shared_library targets (e.g., a Mojo App), add
+# //mojo/public/c/system:for_shared_library to your deps
group("for_shared_library") {
public_deps = [
":system",
]
+ if (is_component_build) {
+ deps = [
+ "//mojo/edk/system",
+ ]
+ } else {
+ deps = [
+ "../../platform/native:system",
+ ]
+ }
}
group("for_component") {
public_deps = [
":system",
]
+ if (is_component_build) {
+ deps = [
+ "//mojo/edk/system",
+ ]
+ }
}
« no previous file with comments | « mojo/mojo_variables.gypi ('k') | mojo/public/c/system/set_thunks_for_app.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698