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