| 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") { | 5 template("python_binary_module") { |
| 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 assert(defined(invoker.python_base_module)) | 9 assert(defined(invoker.python_base_module)) |
| 10 | 10 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 python_flags = "//third_party/cython/python_flags.py" | 45 python_flags = "//third_party/cython/python_flags.py" |
| 46 include_dirs = exec_script(python_flags, | 46 include_dirs = exec_script(python_flags, |
| 47 [ "--gn", "--includes" ], | 47 [ "--gn", "--includes" ], |
| 48 "list lines") | 48 "list lines") |
| 49 libs = exec_script(python_flags, | 49 libs = exec_script(python_flags, |
| 50 [ "--gn", "--libraries" ], | 50 [ "--gn", "--libraries" ], |
| 51 "list lines") | 51 "list lines") |
| 52 lib_dirs = exec_script(python_flags, | 52 lib_dirs = exec_script(python_flags, |
| 53 [ "--gn", "--library_dirs" ], | 53 [ "--gn", "--library_dirs" ], |
| 54 "list lines") | 54 "list lines") |
| 55 if (!is_win) { |
| 56 # Generated code includes static utility functions that often go unused. |
| 57 cflags = [ |
| 58 "-Wno-unused-function", |
| 59 ] |
| 60 } |
| 55 } | 61 } |
| 56 | 62 |
| 57 shared_library(shared_library_name) { | 63 shared_library(shared_library_name) { |
| 58 visibility = target_visibility | 64 visibility = target_visibility |
| 59 deps = [ | 65 deps = [ |
| 60 ":$generator_target_name", | 66 ":$generator_target_name", |
| 61 ] | 67 ] |
| 62 if (defined(invoker.deps)) { | 68 if (defined(invoker.deps)) { |
| 63 deps += invoker.deps | 69 deps += invoker.deps |
| 64 } | 70 } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 75 "$root_out_dir/${shared_library_prefix}${shared_library_name}${shared_libr
ary_suffix}" | 81 "$root_out_dir/${shared_library_prefix}${shared_library_name}${shared_libr
ary_suffix}" |
| 76 ] | 82 ] |
| 77 outputs = [ | 83 outputs = [ |
| 78 "$root_out_dir/python/$python_base_module/${target_name}${python_module_su
ffix}" | 84 "$root_out_dir/python/$python_base_module/${target_name}${python_module_su
ffix}" |
| 79 ] | 85 ] |
| 80 deps = [ | 86 deps = [ |
| 81 ":$shared_library_name" | 87 ":$shared_library_name" |
| 82 ] | 88 ] |
| 83 } | 89 } |
| 84 } | 90 } |
| OLD | NEW |