OLD | NEW |
1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 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 import("../mojo_sdk.gni") | 5 import("../mojo_sdk.gni") |
6 | 6 |
7 config("c_config") { | 7 config("c_config") { |
8 include_dirs = [ "include" ] | 8 include_dirs = [ "include" ] |
9 } | 9 } |
10 | 10 |
11 # Catch-all for all public C headers/libraries, except for the bindings. | 11 # Catch-all for all public C headers/libraries, except for the bindings. |
12 group("c") { | 12 group("c") { |
13 public_deps = [ | 13 public_deps = [ |
14 ":common", | 14 ":common", |
15 ":system", | 15 ":system", |
16 ] | 16 ] |
17 } | 17 } |
18 | 18 |
| 19 # bindings --------------------------------------------------------------------- |
| 20 |
| 21 # Headers in include/mojo/bindings (to be included as <mojo/bindings/HEADER.h>) |
| 22 # and library in lib/bindings. |
| 23 # |
| 24 # Depends on :common and :system (minimally -- just <mojo/system/handle.h>). |
| 25 |
| 26 mojo_sdk_source_set("bindings") { |
| 27 public_configs = [ ":c_config" ] |
| 28 |
| 29 sources = [ |
| 30 # Public headers. |
| 31 "include/mojo/bindings/array.h", |
| 32 "include/mojo/bindings/buffer.h", |
| 33 "include/mojo/bindings/interface.h", |
| 34 "include/mojo/bindings/map.h", |
| 35 "include/mojo/bindings/message.h", |
| 36 "include/mojo/bindings/string.h", |
| 37 "include/mojo/bindings/struct.h", |
| 38 "include/mojo/bindings/union.h", |
| 39 "include/mojo/bindings/validation.h", |
| 40 |
| 41 # Internal headers. |
| 42 "include/mojo/bindings/internal/type_descriptor.h", |
| 43 "include/mojo/bindings/internal/util.h", |
| 44 |
| 45 # Implementation library. |
| 46 # TODO(vtl): Maybe separate this out into a separate source set (or even |
| 47 # static library?). |
| 48 "lib/bindings/array.c", |
| 49 "lib/bindings/buffer.c", |
| 50 "lib/bindings/map.c", |
| 51 "lib/bindings/message.c", |
| 52 "lib/bindings/struct.c", |
| 53 "lib/bindings/type_descriptor.c", |
| 54 "lib/bindings/union.c", |
| 55 ] |
| 56 |
| 57 deps = [ |
| 58 ":system", |
| 59 ] |
| 60 } |
| 61 |
19 # common ----------------------------------------------------------------------- | 62 # common ----------------------------------------------------------------------- |
20 | 63 |
21 # Headers in include/mojo (to be included as <mojo/HEADER.h>). | 64 # Headers in include/mojo (to be included as <mojo/HEADER.h>). |
| 65 # |
| 66 # Depends on nothing. |
22 | 67 |
23 mojo_sdk_source_set("common") { | 68 mojo_sdk_source_set("common") { |
24 public_configs = [ ":c_config" ] | 69 public_configs = [ ":c_config" ] |
25 | 70 |
26 sources = [ | 71 sources = [ |
27 "include/mojo/macros.h", | 72 "include/mojo/macros.h", |
28 "include/mojo/result.h", | 73 "include/mojo/result.h", |
29 ] | 74 ] |
30 } | 75 } |
31 | 76 |
32 mojo_sdk_source_set("common_unittests") { | 77 mojo_sdk_source_set("common_unittests") { |
33 testonly = true | 78 testonly = true |
34 | 79 |
35 sources = [ | 80 sources = [ |
36 "tests/macros_unittest.cc", | 81 "tests/macros_unittest.cc", |
37 "tests/result_unittest.cc", | 82 "tests/result_unittest.cc", |
38 ] | 83 ] |
39 | 84 |
40 deps = [ | 85 deps = [ |
41 ":common", | 86 ":common", |
42 "//testing/gtest", | 87 "//testing/gtest", |
43 ] | 88 ] |
44 } | 89 } |
45 | 90 |
46 # environment ------------------------------------------------------------------ | 91 # environment ------------------------------------------------------------------ |
47 | 92 |
48 # Headers in include/mojo/environment (to be included as | 93 # Headers in include/mojo/environment (to be included as |
49 # <mojo//environment/HEADER.h>). | 94 # <mojo//environment/HEADER.h>). |
| 95 # |
| 96 # Depends on :system (and thus :common). |
50 | 97 |
51 mojo_sdk_source_set("environment") { | 98 mojo_sdk_source_set("environment") { |
52 public_configs = [ ":c_config" ] | 99 public_configs = [ ":c_config" ] |
53 | 100 |
54 sources = [ | 101 sources = [ |
55 "include/mojo/environment/async_waiter.h", | 102 "include/mojo/environment/async_waiter.h", |
56 "include/mojo/environment/logger.h", | 103 "include/mojo/environment/logger.h", |
57 ] | 104 ] |
58 | 105 |
59 public_deps = [ | 106 public_deps = [ |
60 ":system", | 107 ":system", |
61 ] | 108 ] |
62 } | 109 } |
63 | 110 |
64 # system ----------------------------------------------------------------------- | 111 # system ----------------------------------------------------------------------- |
65 | 112 |
66 # Headers in include/mojo/system (to be included as <mojo/system/HEADER.h>). | 113 # Headers in include/mojo/system (to be included as <mojo/system/HEADER.h>). |
| 114 # |
| 115 # Depends on :common. |
67 | 116 |
68 mojo_sdk_source_set("system") { | 117 mojo_sdk_source_set("system") { |
69 public_configs = [ ":c_config" ] | 118 public_configs = [ ":c_config" ] |
70 | 119 |
71 sources = [ | 120 sources = [ |
72 "include/mojo/system/buffer.h", | 121 "include/mojo/system/buffer.h", |
73 "include/mojo/system/data_pipe.h", | 122 "include/mojo/system/data_pipe.h", |
74 "include/mojo/system/handle.h", | 123 "include/mojo/system/handle.h", |
75 "include/mojo/system/main.h", | 124 "include/mojo/system/main.h", |
76 "include/mojo/system/message_pipe.h", | 125 "include/mojo/system/message_pipe.h", |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 | 197 |
149 cflags = [ "-Wundef" ] | 198 cflags = [ "-Wundef" ] |
150 | 199 |
151 sources = [ | 200 sources = [ |
152 "tests/compile/pure_c.c", | 201 "tests/compile/pure_c.c", |
153 "tests/compile/pure_cpp.cc", | 202 "tests/compile/pure_cpp.cc", |
154 ] | 203 ] |
155 | 204 |
156 mojo_sdk_deps = [ "mojo/public/c:environment" ] | 205 mojo_sdk_deps = [ "mojo/public/c:environment" ] |
157 } | 206 } |
OLD | NEW |