OLD | NEW |
| (Empty) |
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 | |
3 # found in the LICENSE file. | |
4 | |
5 import("../mojo_sdk.gni") | |
6 import("//third_party/cython/rules.gni") | |
7 import("rules.gni") | |
8 | |
9 group("python") { | |
10 deps = [ | |
11 ":bindings", | |
12 ":mojo_system", | |
13 ":mojo_system_impl", | |
14 ] | |
15 } | |
16 | |
17 # GYP version: mojo.gyp:mojo_python_system | |
18 python_binary_module("mojo_system") { | |
19 configs = [ "../build/config:mojo_sdk" ] | |
20 deps = [ | |
21 ":system_embedded", | |
22 ] | |
23 } | |
24 | |
25 python_binary_source_set("system_embedded") { | |
26 cython_sources = [ | |
27 "c_async_waiter.pxd", | |
28 "c_core.pxd", | |
29 "c_export.pxd", | |
30 "c_thunks.pxd", | |
31 "mojo_system.pyx", | |
32 ] | |
33 configs = [ "../build/config:mojo_sdk" ] | |
34 deps = [ | |
35 "../c/system", | |
36 "../cpp/bindings:callback", | |
37 "../cpp/system", | |
38 "../cpp/utility", | |
39 "../platform/native:system", | |
40 ] | |
41 } | |
42 | |
43 python_binary_module("mojo_system_impl") { | |
44 cython_sources = [ | |
45 "c_environment.pxd", | |
46 "c_export.pxd", | |
47 "c_thunks.pxd", | |
48 "mojo_system_impl.pyx", | |
49 ] | |
50 sources = [ | |
51 "src/python_system_helper.cc", | |
52 "src/python_system_helper.h", | |
53 ] | |
54 configs = [ "../build/config:mojo_sdk" ] | |
55 deps = [ | |
56 ":python_common", | |
57 "../c/environment", | |
58 "../c/system", | |
59 "../cpp/bindings:callback", | |
60 "../cpp/environment:standalone", | |
61 "../cpp/system", | |
62 "../cpp/utility", | |
63 "../platform/native:system", | |
64 ] | |
65 } | |
66 | |
67 python_binary_source_set("python_common") { | |
68 sources = [ | |
69 "src/common.cc", | |
70 "src/common.h", | |
71 ] | |
72 configs = [ "../build/config:mojo_sdk" ] | |
73 deps = [ | |
74 "../c/environment:environment", | |
75 "../cpp/bindings:callback", | |
76 "../cpp/environment:environment", | |
77 "../cpp/system:system", | |
78 "../cpp/utility", | |
79 ] | |
80 } | |
81 | |
82 python_package("packaged_application") { | |
83 sources = [ | |
84 "mojo_application/__init__.py", | |
85 "mojo_application/application_delegate.py", | |
86 "mojo_application/application_impl.py", | |
87 "mojo_application/application_runner.py", | |
88 "mojo_application/service_provider_impl.py", | |
89 ] | |
90 } | |
91 | |
92 action("import_interface_bindings") { | |
93 visibility = [ ":bindings" ] | |
94 script = rebase_path("mojo/public/tools/gn/unzip.py", ".", mojo_root) | |
95 timestamp = "$target_gen_dir/${target_name}.outputstamp" | |
96 mojom_deps = [ "../interfaces/bindings:bindings_python" ] | |
97 inputs = [] | |
98 foreach(d, mojom_deps) { | |
99 dep_name = get_label_info(d, "name") | |
100 dep_target_out_dir = get_label_info(d, "target_out_dir") | |
101 inputs += [ "$dep_target_out_dir/$dep_name.pyzip" ] | |
102 } | |
103 outputs = [ | |
104 timestamp, | |
105 ] | |
106 rebase_inputs = rebase_path(inputs, root_build_dir) | |
107 rabase_output = rebase_path("$root_out_dir/python", root_build_dir) | |
108 rebase_timestamp = rebase_path(timestamp, root_build_dir) | |
109 args = [ | |
110 "--inputs=${rebase_inputs}", | |
111 "--output=${rabase_output}", | |
112 "--timestamp=${rebase_timestamp}", | |
113 ] | |
114 | |
115 deps = mojom_deps | |
116 } | |
117 | |
118 copy("bindings") { | |
119 sources = [ | |
120 "mojo_bindings/__init__.py", | |
121 "mojo_bindings/descriptor.py", | |
122 "mojo_bindings/interface_reflection.py", | |
123 "mojo_bindings/messaging.py", | |
124 "mojo_bindings/promise.py", | |
125 "mojo_bindings/reflection.py", | |
126 "mojo_bindings/serialization.py", | |
127 ] | |
128 outputs = [ | |
129 "$root_out_dir/python/mojo_bindings/{{source_file_part}}", | |
130 ] | |
131 deps = [ | |
132 ":import_interface_bindings", | |
133 ":mojo_system", | |
134 ] | |
135 } | |
136 | |
137 python_package("packaged_bindings") { | |
138 sources = [ | |
139 "mojo_bindings/__init__.py", | |
140 "mojo_bindings/descriptor.py", | |
141 "mojo_bindings/interface_reflection.py", | |
142 "mojo_bindings/messaging.py", | |
143 "mojo_bindings/promise.py", | |
144 "mojo_bindings/reflection.py", | |
145 "mojo_bindings/serialization.py", | |
146 ] | |
147 | |
148 deps = [ | |
149 "../interfaces/bindings:bindings_python", | |
150 ] | |
151 } | |
OLD | NEW |