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 assert(is_win) | 5 assert(is_win) |
6 | 6 |
7 import("//build/config/win/visual_studio_version.gni") | 7 import("//build/config/win/visual_studio_version.gni") |
8 | 8 |
9 # This template defines a rule to invoke the MS IDL compiler. | 9 # This template defines a rule to invoke the MS IDL compiler. |
10 # | 10 # |
11 # Parameters | 11 # Parameters |
12 # | 12 # |
13 # sources | 13 # sources |
14 # List of .idl file to process. | 14 # List of .idl file to process. |
15 # | 15 # |
16 # out_dir (optional) | 16 # out_dir (optional) |
17 # Directory to write the generated files to. Defaults to target_gen_dir. | 17 # Directory to write the generated files to. Defaults to target_gen_dir. |
18 # | 18 # |
| 19 # deps (optional) |
19 # visibility (optional) | 20 # visibility (optional) |
20 | 21 |
21 template("midl") { | 22 template("midl") { |
22 action_name = "${target_name}_idl_action" | 23 action_name = "${target_name}_idl_action" |
23 source_set_name = target_name | 24 source_set_name = target_name |
24 | 25 |
25 assert(defined(invoker.sources), "Source must be defined for $target_name") | 26 assert(defined(invoker.sources), "Source must be defined for $target_name") |
26 | 27 |
27 if (defined(invoker.out_dir)) { | 28 if (defined(invoker.out_dir)) { |
28 out_dir = invoker.out_dir | 29 out_dir = invoker.out_dir |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 dlldata_file, | 76 dlldata_file, |
76 interface_identifier_file, | 77 interface_identifier_file, |
77 proxy_file, | 78 proxy_file, |
78 "{{source}}", | 79 "{{source}}", |
79 "/char", | 80 "/char", |
80 "signed", | 81 "signed", |
81 "/env", | 82 "/env", |
82 idl_target_platform, | 83 idl_target_platform, |
83 "/Oicf", | 84 "/Oicf", |
84 ] | 85 ] |
| 86 |
| 87 if (defined(invoker.deps)) { |
| 88 deps = invoker.deps |
| 89 } |
85 } | 90 } |
86 | 91 |
87 source_set(target_name) { | 92 source_set(target_name) { |
88 if (defined(invoker.visibility)) { | 93 if (defined(invoker.visibility)) { |
89 visibility = invoker.visibility | 94 visibility = invoker.visibility |
90 } | 95 } |
91 | 96 |
92 # We only compile the IID files from the IDL tool rather than all outputs. | 97 # We only compile the IID files from the IDL tool rather than all outputs. |
93 sources = process_file_template(invoker.sources, | 98 sources = process_file_template(invoker.sources, |
94 [ "$out_dir/$interface_identifier_file" ]) | 99 [ "$out_dir/$interface_identifier_file" ]) |
95 | 100 |
96 deps = [ | 101 deps = [ |
97 ":$action_name", | 102 ":$action_name", |
98 ] | 103 ] |
99 } | 104 } |
100 } | 105 } |
OLD | NEW |