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 import("//third_party/cython/rules.gni") | 5 import("//third_party/cython/rules.gni") |
6 | 6 |
7 group("python") { | 7 group("python") { |
8 deps = [ | 8 deps = [ |
9 ":base", | |
10 ":bindings", | 9 ":bindings", |
11 ":system", | 10 ":mojo_system", |
12 ":system_impl", | 11 ":mojo_system_impl", |
13 ] | 12 ] |
14 } | 13 } |
15 | 14 |
16 # GYP version: mojo.gyp:mojo_python_system | 15 # GYP version: mojo.gyp:mojo_python_system |
17 python_binary_module("system") { | 16 python_binary_module("mojo_system") { |
18 python_base_module = "mojo" | 17 python_base_module = "" |
19 configs = [ "../build/config:mojo_sdk" ] | 18 configs = [ "../build/config:mojo_sdk" ] |
20 deps = [ | 19 deps = [ |
21 ":system_embedded", | 20 ":system_embedded", |
22 ] | 21 ] |
23 } | 22 } |
24 | 23 |
25 python_binary_source_set("system_embedded") { | 24 python_binary_source_set("system_embedded") { |
26 cython_sources = [ | 25 cython_sources = [ |
27 "mojo/c_async_waiter.pxd", | 26 "c_async_waiter.pxd", |
28 "mojo/c_core.pxd", | 27 "c_core.pxd", |
29 "mojo/c_export.pxd", | 28 "c_export.pxd", |
30 "mojo/c_thunks.pxd", | 29 "c_thunks.pxd", |
31 "mojo/system.pyx", | 30 "mojo_system.pyx", |
32 ] | 31 ] |
33 configs = [ "../build/config:mojo_sdk" ] | 32 configs = [ "../build/config:mojo_sdk" ] |
34 deps = [ | 33 deps = [ |
35 ":base", | |
36 "../c/system", | 34 "../c/system", |
37 "../cpp/bindings:callback", | 35 "../cpp/bindings:callback", |
38 "../cpp/system", | 36 "../cpp/system", |
39 "../cpp/utility", | 37 "../cpp/utility", |
40 "../platform/native:system", | 38 "../platform/native:system", |
41 ] | 39 ] |
42 } | 40 } |
43 | 41 |
44 python_binary_module("system_impl") { | 42 python_binary_module("mojo_system_impl") { |
45 python_base_module = "mojo" | 43 python_base_module = "" |
46 cython_sources = [ | 44 cython_sources = [ |
47 "mojo/c_environment.pxd", | 45 "c_environment.pxd", |
48 "mojo/c_export.pxd", | 46 "c_export.pxd", |
49 "mojo/c_thunks.pxd", | 47 "c_thunks.pxd", |
50 "mojo/system_impl.pyx", | 48 "mojo_system_impl.pyx", |
51 ] | 49 ] |
52 sources = [ | 50 sources = [ |
53 "src/python_system_helper.cc", | 51 "src/python_system_helper.cc", |
54 "src/python_system_helper.h", | 52 "src/python_system_helper.h", |
55 ] | 53 ] |
56 configs = [ "../build/config:mojo_sdk" ] | 54 configs = [ "../build/config:mojo_sdk" ] |
57 deps = [ | 55 deps = [ |
58 ":base", | |
59 ":python_common", | 56 ":python_common", |
60 "../c/environment", | 57 "../c/environment", |
61 "../c/system", | 58 "../c/system", |
62 "../cpp/bindings:callback", | 59 "../cpp/bindings:callback", |
63 "../cpp/environment:standalone", | 60 "../cpp/environment:standalone", |
64 "../cpp/system", | 61 "../cpp/system", |
65 "../cpp/utility", | 62 "../cpp/utility", |
66 "../platform/native:system", | 63 "../platform/native:system", |
67 ] | 64 ] |
68 } | 65 } |
69 | 66 |
70 python_binary_source_set("python_common") { | 67 python_binary_source_set("python_common") { |
71 sources = [ | 68 sources = [ |
72 "src/common.cc", | 69 "src/common.cc", |
73 "src/common.h", | 70 "src/common.h", |
74 ] | 71 ] |
75 configs = [ "../build/config:mojo_sdk" ] | 72 configs = [ "../build/config:mojo_sdk" ] |
76 deps = [ | 73 deps = [ |
77 "../c/environment:environment", | 74 "../c/environment:environment", |
78 "../cpp/bindings:callback", | 75 "../cpp/bindings:callback", |
79 "../cpp/environment:environment", | 76 "../cpp/environment:environment", |
80 "../cpp/system:system", | 77 "../cpp/system:system", |
81 "../cpp/utility", | 78 "../cpp/utility", |
82 ] | 79 ] |
83 } | 80 } |
84 | 81 |
85 copy("base") { | |
86 sources = [ | |
87 "mojo/__init__.py", | |
88 ] | |
89 outputs = [ | |
90 "$root_out_dir/python/mojo/{{source_file_part}}", | |
91 ] | |
92 } | |
93 | |
94 # GYP version: mojo.gyp:mojo_python_bindings | 82 # GYP version: mojo.gyp:mojo_python_bindings |
95 copy("bindings") { | 83 copy("bindings") { |
96 sources = [ | 84 sources = [ |
97 "mojo/bindings/__init__.py", | 85 "mojo_bindings/__init__.py", |
98 "mojo/bindings/descriptor.py", | 86 "mojo_bindings/descriptor.py", |
99 "mojo/bindings/messaging.py", | 87 "mojo_bindings/messaging.py", |
100 "mojo/bindings/promise.py", | 88 "mojo_bindings/promise.py", |
101 "mojo/bindings/reflection.py", | 89 "mojo_bindings/reflection.py", |
102 "mojo/bindings/serialization.py", | 90 "mojo_bindings/serialization.py", |
103 ] | 91 ] |
104 outputs = [ | 92 outputs = [ |
105 "$root_out_dir/python/mojo/bindings/{{source_file_part}}", | 93 "$root_out_dir/python/mojo_bindings/{{source_file_part}}", |
106 ] | 94 ] |
107 deps = [ | 95 deps = [ |
108 ":base", | 96 ":mojo_system", |
109 ":system", | |
110 ] | 97 ] |
111 } | 98 } |
OLD | NEW |