BUILD.gn 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. # Copyright 2021 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. if (current_toolchain == default_toolchain) {
  5. import("//build/toolchain/toolchain.gni")
  6. # A toolchain that will capture compiler and linker arguments to a file.
  7. toolchain("flagcapture") {
  8. tool("cxx") {
  9. cxx = rebase_path("argcapture.py", root_build_dir)
  10. command = "$cxx {{output}} {{defines}} {{include_dirs}} {{cflags}} {{cflags_cc}}"
  11. outputs = [ "{{root_out_dir}}/{{label_name}}.txt" ]
  12. }
  13. tool("solink") {
  14. solink = rebase_path("argcapture.py", root_build_dir)
  15. command = "$solink {{output}} {{ldflags}}"
  16. outputs = [ "{{root_out_dir}}/{{label_name}}.txt" ]
  17. }
  18. tool("alink") {
  19. command = "this-should-never-run"
  20. outputs = [ "this-will-never-exist" ]
  21. }
  22. tool("stamp") {
  23. command = stamp_command
  24. description = stamp_description
  25. }
  26. }
  27. } else if (current_toolchain == "//build/android/native_flags:flagcapture") {
  28. # This will record flags from all default configs of the default toolchain.
  29. source_set("default_ccflags") {
  30. sources = [ "empty.cc" ]
  31. }
  32. shared_library("default_ldflags") {
  33. no_default_deps = true
  34. }
  35. }