| 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 declare_args() { |
| 6 # Indicates whether typemapping should be supported in this build |
| 7 # configuration. This may be disabled when building external projects which |
| 8 # depend on //mojo but which do not need/want all of the Chromium tree |
| 9 # dependencies that come with typemapping. |
| 10 # |
| 11 # Note that (perhaps obviously) a huge amount of Chromium code will not build |
| 12 # with typemapping disabled, so it is never valid to set this to |false| in |
| 13 # any Chromium build configuration. |
| 14 enable_mojom_typemapping = true |
| 15 } |
| 16 |
| 5 mojom_generator_root = "//mojo/public/tools/bindings" | 17 mojom_generator_root = "//mojo/public/tools/bindings" |
| 6 mojom_generator_script = "$mojom_generator_root/mojom_bindings_generator.py" | 18 mojom_generator_script = "$mojom_generator_root/mojom_bindings_generator.py" |
| 7 mojom_generator_sources = [ | 19 mojom_generator_sources = [ |
| 8 "$mojom_generator_root/generators/mojom_cpp_generator.py", | 20 "$mojom_generator_root/generators/mojom_cpp_generator.py", |
| 9 "$mojom_generator_root/generators/mojom_js_generator.py", | 21 "$mojom_generator_root/generators/mojom_js_generator.py", |
| 10 "$mojom_generator_root/generators/mojom_java_generator.py", | 22 "$mojom_generator_root/generators/mojom_java_generator.py", |
| 11 "$mojom_generator_root/pylib/mojom/__init__.py", | 23 "$mojom_generator_root/pylib/mojom/__init__.py", |
| 12 "$mojom_generator_root/pylib/mojom/error.py", | 24 "$mojom_generator_root/pylib/mojom/error.py", |
| 13 "$mojom_generator_root/pylib/mojom/generate/__init__.py", | 25 "$mojom_generator_root/pylib/mojom/generate/__init__.py", |
| 14 "$mojom_generator_root/pylib/mojom/generate/constant_resolver.py", | 26 "$mojom_generator_root/pylib/mojom/generate/constant_resolver.py", |
| 15 "$mojom_generator_root/pylib/mojom/generate/generator.py", | 27 "$mojom_generator_root/pylib/mojom/generate/generator.py", |
| 16 "$mojom_generator_root/pylib/mojom/generate/module.py", | 28 "$mojom_generator_root/pylib/mojom/generate/module.py", |
| 17 "$mojom_generator_root/pylib/mojom/generate/pack.py", | 29 "$mojom_generator_root/pylib/mojom/generate/pack.py", |
| 18 "$mojom_generator_root/pylib/mojom/generate/template_expander.py", | 30 "$mojom_generator_root/pylib/mojom/generate/template_expander.py", |
| 19 "$mojom_generator_root/pylib/mojom/generate/translate.py", | 31 "$mojom_generator_root/pylib/mojom/generate/translate.py", |
| 20 "$mojom_generator_root/pylib/mojom/parse/__init__.py", | 32 "$mojom_generator_root/pylib/mojom/parse/__init__.py", |
| 21 "$mojom_generator_root/pylib/mojom/parse/ast.py", | 33 "$mojom_generator_root/pylib/mojom/parse/ast.py", |
| 22 "$mojom_generator_root/pylib/mojom/parse/lexer.py", | 34 "$mojom_generator_root/pylib/mojom/parse/lexer.py", |
| 23 "$mojom_generator_root/pylib/mojom/parse/parser.py", | 35 "$mojom_generator_root/pylib/mojom/parse/parser.py", |
| 24 "$mojom_generator_script", | 36 "$mojom_generator_script", |
| 25 ] | 37 ] |
| 26 | 38 |
| 27 if (!is_ios) { | 39 if (enable_mojom_typemapping) { |
| 28 _bindings_configuration_files = [ | 40 if (!is_ios) { |
| 29 "//mojo/public/tools/bindings/chromium_bindings_configuration.gni", | 41 _bindings_configuration_files = [ |
| 30 "//mojo/public/tools/bindings/blink_bindings_configuration.gni", | 42 "//mojo/public/tools/bindings/chromium_bindings_configuration.gni", |
| 31 ] | 43 "//mojo/public/tools/bindings/blink_bindings_configuration.gni", |
| 32 } else { | 44 ] |
| 33 _bindings_configuration_files = | 45 } else { |
| 34 [ "//mojo/public/tools/bindings/chromium_bindings_configuration.gni" ] | 46 _bindings_configuration_files = |
| 35 } | 47 [ "//mojo/public/tools/bindings/chromium_bindings_configuration.gni" ] |
| 36 _bindings_configurations = [] | |
| 37 foreach(config_file, _bindings_configuration_files) { | |
| 38 _bindings_configurations += [ read_file(config_file, "scope") ] | |
| 39 } | |
| 40 foreach(configuration, _bindings_configurations) { | |
| 41 # Check that the mojom field of each typemap refers to a mojom that exists. | |
| 42 foreach(typemap, configuration.typemaps) { | |
| 43 _typemap_config = { | |
| 44 } | |
| 45 _typemap_config = typemap.config | |
| 46 read_file(_typemap_config.mojom, "") | |
| 47 } | 48 } |
| 48 if (is_mac && defined(configuration.typemaps_mac)) { | 49 _bindings_configurations = [] |
| 49 foreach(typemap, configuration.typemaps_mac) { | 50 foreach(config_file, _bindings_configuration_files) { |
| 51 _bindings_configurations += [ read_file(config_file, "scope") ] |
| 52 } |
| 53 foreach(configuration, _bindings_configurations) { |
| 54 # Check that the mojom field of each typemap refers to a mojom that exists. |
| 55 foreach(typemap, configuration.typemaps) { |
| 50 _typemap_config = { | 56 _typemap_config = { |
| 51 } | 57 } |
| 52 _typemap_config = typemap.config | 58 _typemap_config = typemap.config |
| 53 read_file(_typemap_config.mojom, "") | 59 read_file(_typemap_config.mojom, "") |
| 54 } | 60 } |
| 61 if (is_mac && defined(configuration.typemaps_mac)) { |
| 62 foreach(typemap, configuration.typemaps_mac) { |
| 63 _typemap_config = { |
| 64 } |
| 65 _typemap_config = typemap.config |
| 66 read_file(_typemap_config.mojom, "") |
| 67 } |
| 68 } |
| 55 } | 69 } |
| 70 } else { |
| 71 _bindings_configuration_files = [] |
| 72 _bindings_configurations = [ |
| 73 { |
| 74 typemaps = [] |
| 75 }, |
| 76 { |
| 77 variant = "blink" |
| 78 for_blink = true |
| 79 typemaps = [] |
| 80 }, |
| 81 ] |
| 56 } | 82 } |
| 57 | 83 |
| 58 # Generates targets for building C++, JavaScript and Java bindings from mojom | 84 # Generates targets for building C++, JavaScript and Java bindings from mojom |
| 59 # files. The output files will go under the generated file directory tree with | 85 # files. The output files will go under the generated file directory tree with |
| 60 # the same path as each input file. | 86 # the same path as each input file. |
| 61 # | 87 # |
| 62 # Other targets should depend on one of these generated targets (where "foo" | 88 # Other targets should depend on one of these generated targets (where "foo" |
| 63 # is the target name): | 89 # is the target name): |
| 64 # | 90 # |
| 65 # foo | 91 # foo |
| (...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 599 full_name = get_label_info(d, "label_no_toolchain") | 625 full_name = get_label_info(d, "label_no_toolchain") |
| 600 deps += [ "${full_name}_java" ] | 626 deps += [ "${full_name}_java" ] |
| 601 } | 627 } |
| 602 | 628 |
| 603 srcjar_deps = [ ":$java_srcjar_target_name" ] | 629 srcjar_deps = [ ":$java_srcjar_target_name" ] |
| 604 run_findbugs_override = false | 630 run_findbugs_override = false |
| 605 } | 631 } |
| 606 } | 632 } |
| 607 } | 633 } |
| 608 } | 634 } |
| OLD | NEW |