OLD | NEW |
---|---|
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 source_set("system") { | 5 # Depend on this target to use the types etc defined in the system without |
6 # linking against a specific implementation of the system. To link against a | |
7 # particular implementation, use the :for_component or | |
8 # :for_shared_library targets, depending on the type of target you are. | |
9 source_set("headers") { | |
6 sources = [ | 10 sources = [ |
7 "../../platform/native/system_thunks.cc", | |
8 "../../platform/native/system_thunks.h", | 11 "../../platform/native/system_thunks.h", |
9 "buffer.h", | 12 "buffer.h", |
10 "core.h", | 13 "core.h", |
11 "data_pipe.h", | 14 "data_pipe.h", |
12 "functions.h", | 15 "functions.h", |
13 "macros.h", | 16 "macros.h", |
14 "message_pipe.h", | 17 "message_pipe.h", |
15 "system_export.h", | 18 "system_export.h", |
16 "types.h", | 19 "types.h", |
17 ] | 20 ] |
18 defines = [ "MOJO_SYSTEM_IMPLEMENTATION" ] | |
19 | |
20 # The GYP target analogous to this one builds this code into a | |
21 # static library. When building for Android, both the GYP and GN | |
22 # builds add --exclude-libs=ALL globally, which means that all | |
23 # symbols in static libraries are excluded from export. That's a | |
24 # problem, as code outside this target needs to be able to call | |
25 # MojoSetSystemThunks(). Therefore, the GYP target needs to specifiy | |
26 # that all dependent targets remove that link flag. Since GN uses a | |
27 # source_set here, this flag change is not needed. | |
28 } | 21 } |
29 | 22 |
30 # In an is_component_build build, everything can link against //mojo/system | 23 # In an is_component_build build, everything can link against //mojo/system |
31 # because it is built as a shared library. However, in a static build, | 24 # because it is built as a shared library. However, in a static build, |
32 # //mojo/system is linked into an executable (e.g., mojo_shell), and must be | 25 # //mojo/system is linked into an executable (e.g., mojo_shell), and must be |
33 # injected into other shared libraries (i.e., Mojo Apps) that need the mojo | 26 # injected into other shared libraries (i.e., Mojo Apps) that need the mojo |
34 # system API. | 27 # system API. |
35 # | 28 # |
36 # For component targets, add //mojo/public/c/system:for_component to your deps | 29 # For component targets, add //mojo/public/c/system:for_component to your deps |
37 # section. | 30 # section. |
38 # | 31 # |
39 # For shared_library targets (e.g., a Mojo App), add | 32 # For shared_library targets (e.g., a Mojo App), add |
40 # //mojo/public/c/system:for_shared_library to your deps | 33 # //mojo/public/c/system:for_shared_library to your deps |
41 | 34 |
42 group("for_shared_library") { | 35 group("for_shared_library") { |
36 public_deps = [ ":headers" ] | |
43 if (is_component_build) { | 37 if (is_component_build) { |
44 deps = [ "//mojo/system" ] | 38 deps = [ "//mojo/system" ] |
45 } else { | 39 } else { |
46 deps = [ ":system" ] | 40 deps = [ ":system" ] |
47 } | 41 } |
48 } | 42 } |
49 | 43 |
50 group("for_component") { | 44 group("for_component") { |
45 public_deps = [ ":headers" ] | |
51 if (is_component_build) { | 46 if (is_component_build) { |
52 deps = [ "//mojo/system" ] | 47 deps = [ "//mojo/system" ] |
53 } | 48 } |
54 } | 49 } |
50 | |
51 source_set("system") { | |
viettrungluu
2014/09/25 00:36:21
Maybe it'd be more consistent (with the pattern fo
| |
52 visibility = [ ":for_component", ":for_shared_library", "//mojo/public" ] | |
53 | |
54 sources = [ | |
55 "../../platform/native/system_thunks.cc", | |
56 ] | |
57 defines = [ "MOJO_SYSTEM_IMPLEMENTATION" ] | |
58 deps = [ ":headers" ] | |
59 | |
60 # The GYP target analogous to this one builds this code into a | |
61 # static library. When building for Android, both the GYP and GN | |
62 # builds add --exclude-libs=ALL globally, which means that all | |
63 # symbols in static libraries are excluded from export. That's a | |
64 # problem, as code outside this target needs to be able to call | |
65 # MojoSetSystemThunks(). Therefore, the GYP target needs to specifiy | |
66 # that all dependent targets remove that link flag. Since GN uses a | |
67 # source_set here, this flag change is not needed. | |
68 } | |
69 | |
70 | |
OLD | NEW |