BUILD.gn 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. # Copyright 2022 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. import("//build/config/features.gni")
  5. if (is_win) {
  6. # This is in a separate config so the flags can be applied to dependents.
  7. # ldflags in GN aren't automatically inherited.
  8. config("compute_pressure_win_linker_flags") {
  9. libs = [ "pdh.lib" ]
  10. ldflags = [ "/DELAYLOAD:pdh.dll" ]
  11. }
  12. }
  13. source_set("compute_pressure") {
  14. visibility = [ "//services/device:*" ]
  15. sources = [
  16. "cpu_probe.cc",
  17. "cpu_probe.h",
  18. "platform_collector.cc",
  19. "platform_collector.h",
  20. "pressure_manager_impl.cc",
  21. "pressure_manager_impl.h",
  22. "pressure_sample.h",
  23. ]
  24. public_deps = [ "//services/device/public/mojom" ]
  25. deps = [
  26. "//base",
  27. "//mojo/public/cpp/bindings",
  28. ]
  29. if (is_linux || is_chromeos) {
  30. sources += [
  31. "core_times.cc",
  32. "core_times.h",
  33. "cpu_probe_linux.cc",
  34. "cpu_probe_linux.h",
  35. "procfs_stat_cpu_parser.cc",
  36. "procfs_stat_cpu_parser.h",
  37. ]
  38. }
  39. if (is_win) {
  40. sources += [
  41. "cpu_probe_win.cc",
  42. "cpu_probe_win.h",
  43. "scoped_pdh_query.cc",
  44. "scoped_pdh_query.h",
  45. ]
  46. all_dependent_configs = [ ":compute_pressure_win_linker_flags" ]
  47. }
  48. if (is_mac) {
  49. sources += [
  50. "core_times.cc",
  51. "core_times.h",
  52. "cpu_probe_mac.cc",
  53. "cpu_probe_mac.h",
  54. "host_processor_info_scanner.cc",
  55. "host_processor_info_scanner.h",
  56. ]
  57. }
  58. }