| 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 # Depend on this target to use the types etc defined in the system without | 5 component("system") { |
| 6 # linking against a specific implementation of the system. To link against a | 6 output_name = "mojo_public_system" |
| 7 # particular implementation, use the :for_component or | 7 |
| 8 # :for_shared_library targets, depending on the type of target you are. | |
| 9 source_set("system") { | |
| 10 sources = [ | 8 sources = [ |
| 11 "buffer.h", | 9 "buffer.h", |
| 12 "core.h", | 10 "core.h", |
| 13 "data_pipe.h", | 11 "data_pipe.h", |
| 14 "functions.h", | 12 "functions.h", |
| 15 "macros.h", | 13 "macros.h", |
| 16 "message_pipe.h", | 14 "message_pipe.h", |
| 17 "platform_handle.h", | 15 "platform_handle.h", |
| 18 "system_export.h", | 16 "system_export.h", |
| 17 "thunks.cc", |
| 18 "thunks.h", |
| 19 "types.h", | 19 "types.h", |
| 20 "wait_set.h", | 20 "wait_set.h", |
| 21 ] | 21 ] |
| 22 |
| 23 defines = [ "MOJO_SYSTEM_IMPLEMENTATION" ] |
| 22 } | 24 } |
| 23 | 25 |
| 24 # In an is_component_build build, everything can link against //mojo/edk/system | 26 # This should ONLY be depended upon directly by shared_library targets which |
| 25 # because it is built as a shared library. However, in a static build, | 27 # need to export the MojoSetSystemThunks symbol, like targets generated by the |
| 26 # //mojo/edk/system is linked into an executable (e.g., mojo_shell), and must be | 28 # mojo_native_application template in //mojo/public/mojo_application.gni. |
| 27 # injected into other shared libraries (i.e., Mojo Apps) that need the mojo | 29 source_set("set_thunks_for_app") { |
| 28 # system API. | 30 sources = [ |
| 29 # | 31 "set_thunks_for_app.cc", |
| 30 # For component targets, add //mojo/public/c/system:for_component to your deps | 32 ] |
| 31 # section. | 33 |
| 32 # | 34 public_deps = [ |
| 33 # For shared_library targets (e.g., a Mojo App), add | 35 ":system", |
| 34 # //mojo/public/c/system:for_shared_library to your deps | 36 ] |
| 37 } |
| 38 |
| 39 # TODO(rockot): Delete these deprecated aliases. |
| 35 | 40 |
| 36 group("for_shared_library") { | 41 group("for_shared_library") { |
| 37 public_deps = [ | 42 public_deps = [ |
| 38 ":system", | 43 ":system", |
| 39 ] | 44 ] |
| 40 if (is_component_build) { | |
| 41 deps = [ | |
| 42 "//mojo/edk/system", | |
| 43 ] | |
| 44 } else { | |
| 45 deps = [ | |
| 46 "../../platform/native:system", | |
| 47 ] | |
| 48 } | |
| 49 } | 45 } |
| 50 | 46 |
| 51 group("for_component") { | 47 group("for_component") { |
| 52 public_deps = [ | 48 public_deps = [ |
| 53 ":system", | 49 ":system", |
| 54 ] | 50 ] |
| 55 if (is_component_build) { | |
| 56 deps = [ | |
| 57 "//mojo/edk/system", | |
| 58 ] | |
| 59 } | |
| 60 } | 51 } |
| OLD | NEW |