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 template("python_binary_module_sources") { | 5 template("python_binary_module_sources") { |
6 # Only available on linux for now. | 6 # Only available on linux for now. |
7 assert(is_linux) | 7 assert(is_linux) |
8 assert(defined(invoker.sources)) | 8 assert(defined(invoker.sources)) |
9 | 9 |
10 cython_root = "//third_party/cython" | 10 cython_root = "//third_party/cython" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 } | 56 } |
57 if (defined(invoker.datadeps)) { | 57 if (defined(invoker.datadeps)) { |
58 datadeps = invoker.datadeps | 58 datadeps = invoker.datadeps |
59 } | 59 } |
60 sources = [ | 60 sources = [ |
61 cython_output, | 61 cython_output, |
62 ] | 62 ] |
63 if (defined(invoker.additional_sources)) { | 63 if (defined(invoker.additional_sources)) { |
64 sources += invoker.additional_sources | 64 sources += invoker.additional_sources |
65 } | 65 } |
| 66 if (defined(invoker.configs)) { |
| 67 configs += invoker.configs |
| 68 } |
66 all_dependent_configs = [ ":$config_name" ] | 69 all_dependent_configs = [ ":$config_name" ] |
67 } | 70 } |
68 } | 71 } |
69 | 72 |
70 template("python_binary_module") { | 73 template("python_binary_module") { |
71 # Only available on linux for now. | 74 # Only available on linux for now. |
72 assert(is_linux) | 75 assert(is_linux) |
73 assert(defined(invoker.sources)) | 76 assert(defined(invoker.sources)) |
74 assert(defined(invoker.python_base_module)) | 77 assert(defined(invoker.python_base_module)) |
75 | 78 |
76 sources_target_name = target_name + "_cython_sources" | 79 sources_target_name = target_name + "_cython_sources" |
77 shared_library_name = target_name + "_shared_library" | 80 shared_library_name = target_name + "_shared_library" |
78 | 81 |
79 if (is_linux) { | 82 if (is_linux) { |
80 shared_library_prefix = "lib" | 83 shared_library_prefix = "lib" |
81 shared_library_suffix = ".so" | 84 shared_library_suffix = ".so" |
82 python_module_suffix = ".so" | 85 python_module_suffix = ".so" |
83 } | 86 } |
84 | 87 |
85 target_visibility = [ | 88 target_visibility = [ |
86 ":$sources_target_name", | 89 ":$sources_target_name", |
87 ":$shared_library_name", | 90 ":$shared_library_name", |
88 ":$target_name", | 91 ":$target_name", |
89 ] | 92 ] |
90 | 93 |
91 python_binary_module_sources(sources_target_name) { | 94 python_binary_module_sources(sources_target_name) { |
92 visibility = target_visibility | 95 visibility = target_visibility |
93 sources = invoker.sources | 96 sources = invoker.sources |
| 97 if (defined(invoker.configs)) { |
| 98 configs = invoker.configs |
| 99 } |
94 } | 100 } |
95 | 101 |
96 shared_library(shared_library_name) { | 102 shared_library(shared_library_name) { |
97 visibility = target_visibility | 103 visibility = target_visibility |
98 deps = [ | 104 deps = [ |
99 ":$sources_target_name", | 105 ":$sources_target_name", |
100 ] | 106 ] |
101 if (defined(invoker.deps)) { | 107 if (defined(invoker.deps)) { |
102 deps += invoker.deps | 108 deps += invoker.deps |
103 } | 109 } |
(...skipping 14 matching lines...) Expand all Loading... |
118 "$root_out_dir/${shared_library_prefix}${shared_library_name}${shared_libr
ary_suffix}", | 124 "$root_out_dir/${shared_library_prefix}${shared_library_name}${shared_libr
ary_suffix}", |
119 ] | 125 ] |
120 outputs = [ | 126 outputs = [ |
121 "$root_out_dir/python/$python_base_module/${target_name}${python_module_su
ffix}", | 127 "$root_out_dir/python/$python_base_module/${target_name}${python_module_su
ffix}", |
122 ] | 128 ] |
123 deps = [ | 129 deps = [ |
124 ":$shared_library_name", | 130 ":$shared_library_name", |
125 ] | 131 ] |
126 } | 132 } |
127 } | 133 } |
OLD | NEW |