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

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

Issue 599283003: Make gn check //mojo/public/* pass (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
Index: mojo/public/c/system/BUILD.gn
diff --git a/mojo/public/c/system/BUILD.gn b/mojo/public/c/system/BUILD.gn
index 38a348680331a032e14b2307dfcae185890dd753..5c9a164ed8767f611243d3cec38a19a4a1d9e88b 100644
--- a/mojo/public/c/system/BUILD.gn
+++ b/mojo/public/c/system/BUILD.gn
@@ -2,9 +2,12 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-source_set("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("headers") {
sources = [
- "../../platform/native/system_thunks.cc",
"../../platform/native/system_thunks.h",
"buffer.h",
"core.h",
@@ -15,16 +18,6 @@ source_set("system") {
"system_export.h",
"types.h",
]
- defines = [ "MOJO_SYSTEM_IMPLEMENTATION" ]
-
- # The GYP target analogous to this one builds this code into a
- # static library. When building for Android, both the GYP and GN
- # builds add --exclude-libs=ALL globally, which means that all
- # symbols in static libraries are excluded from export. That's a
- # problem, as code outside this target needs to be able to call
- # MojoSetSystemThunks(). Therefore, the GYP target needs to specifiy
- # that all dependent targets remove that link flag. Since GN uses a
- # source_set here, this flag change is not needed.
}
# In an is_component_build build, everything can link against //mojo/system
@@ -40,6 +33,7 @@ source_set("system") {
# //mojo/public/c/system:for_shared_library to your deps
group("for_shared_library") {
+ public_deps = [ ":headers" ]
if (is_component_build) {
deps = [ "//mojo/system" ]
} else {
@@ -48,7 +42,29 @@ group("for_shared_library") {
}
group("for_component") {
+ public_deps = [ ":headers" ]
if (is_component_build) {
deps = [ "//mojo/system" ]
}
}
+
+source_set("system") {
viettrungluu 2014/09/25 00:36:21 Maybe it'd be more consistent (with the pattern fo
+ visibility = [ ":for_component", ":for_shared_library", "//mojo/public" ]
+
+ sources = [
+ "../../platform/native/system_thunks.cc",
+ ]
+ defines = [ "MOJO_SYSTEM_IMPLEMENTATION" ]
+ deps = [ ":headers" ]
+
+ # The GYP target analogous to this one builds this code into a
+ # static library. When building for Android, both the GYP and GN
+ # builds add --exclude-libs=ALL globally, which means that all
+ # symbols in static libraries are excluded from export. That's a
+ # problem, as code outside this target needs to be able to call
+ # MojoSetSystemThunks(). Therefore, the GYP target needs to specifiy
+ # that all dependent targets remove that link flag. Since GN uses a
+ # source_set here, this flag change is not needed.
+}
+
+

Powered by Google App Engine
This is Rietveld 408576698