Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 # found in the LICENSE file. | |
| 4 | |
| 5 # name: Name to use for the value of the --name arg. | |
|
awong
2014/07/01 21:47:11
Can we add a sentence or two explaining what as li
brettw
2014/07/01 23:26:27
I added a brief one. I don't actually know any mor
awong
2014/07/01 23:30:46
Huh...looking at this file more closely, it feels
| |
| 6 # output_h/output_cc: Names for the generated header/cc file with no dir. | |
| 7 # header: header file to process. Example: "<foo/bar.h>" | |
| 8 # functions: List of strings for functions to process. | |
| 9 # config: (optional) Label of the config generated by pkgconfig. | |
| 10 # bundled_header: (optional) | |
| 11 template("generate_library_loader") { | |
| 12 output_h = "$root_gen_dir/library_loaders/" + invoker.output_h | |
| 13 output_cc = "$root_gen_dir/library_loaders/" + invoker.output_cc | |
| 14 | |
| 15 action_visibility = ":$target_name" | |
| 16 action("${target_name}_loader") { | |
| 17 visibility = action_visibility | |
| 18 | |
| 19 script = "//tools/generate_library_loader/generate_library_loader.py" | |
| 20 if (defined(invoker.visibility)) { | |
| 21 visibility = invoker.visibility | |
| 22 } | |
| 23 | |
| 24 outputs = [ output_h, output_cc ] | |
| 25 | |
| 26 args = [ | |
| 27 "--name", invoker.name, | |
| 28 "--output-h", rebase_path(output_h), | |
| 29 "--output-cc", rebase_path(output_cc), | |
| 30 "--header", invoker.header, | |
| 31 # Note GYP build exposes a per-target variable to control this, which, if | |
| 32 # manually set to true, will disable dlopen(). Its not clear this is | |
| 33 # needed, so here we just leave off. If this can be done globally, we can | |
| 34 # expose one switch for this value, otherwise we need to add a template | |
| 35 # param for this. | |
| 36 "--link-directly=0", | |
| 37 ] | |
| 38 if (defined(invoker.bundled_header)) { | |
| 39 args += [ "--bundled-header", invoker.bundled_header ] | |
| 40 } | |
| 41 args += invoker.functions | |
| 42 } | |
| 43 | |
| 44 source_set(target_name) { | |
| 45 if (defined(invoker.config)) { | |
| 46 direct_dependent_configs = [ invoker.config ] | |
| 47 } | |
| 48 sources = [ output_h, output_cc ] | |
| 49 deps = [ ":${target_name}_loader" ] | |
| 50 } | |
| 51 } | |
| OLD | NEW |