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