shim_headers.gni 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. # Copyright 2016 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. template("shim_headers") {
  5. action_name = "gen_${target_name}"
  6. config_name = "${target_name}_config"
  7. shim_headers_path = "${root_gen_dir}/shim_headers/${target_name}"
  8. config(config_name) {
  9. include_dirs = [ shim_headers_path ]
  10. }
  11. action(action_name) {
  12. script = "//tools/generate_shim_headers/generate_shim_headers.py"
  13. args = [
  14. "--generate",
  15. "--headers-root",
  16. rebase_path(invoker.root_path),
  17. "--output-directory",
  18. rebase_path(shim_headers_path),
  19. ]
  20. if (defined(invoker.prefix)) {
  21. args += [
  22. "--prefix",
  23. invoker.prefix,
  24. ]
  25. }
  26. args += invoker.headers
  27. outputs = process_file_template(invoker.headers,
  28. "${shim_headers_path}/{{source_file_part}}")
  29. }
  30. group(target_name) {
  31. deps = [ ":${action_name}" ]
  32. all_dependent_configs = [ ":${config_name}" ]
  33. }
  34. }