BUILD.gn 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. # Copyright 2019 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/chromeos/ui_mode.gni")
  5. import("//build/config/features.gni")
  6. static_library("sync_device_info") {
  7. sources = [
  8. "device_count_metrics_provider.cc",
  9. "device_count_metrics_provider.h",
  10. "device_info.cc",
  11. "device_info.h",
  12. "device_info_prefs.cc",
  13. "device_info_prefs.h",
  14. "device_info_sync_bridge.cc",
  15. "device_info_sync_bridge.h",
  16. "device_info_sync_client.cc",
  17. "device_info_sync_client.h",
  18. "device_info_sync_service.cc",
  19. "device_info_sync_service.h",
  20. "device_info_sync_service_impl.cc",
  21. "device_info_sync_service_impl.h",
  22. "device_info_tracker.h",
  23. "device_info_util.cc",
  24. "device_info_util.h",
  25. "local_device_info_provider.h",
  26. "local_device_info_provider_impl.cc",
  27. "local_device_info_provider_impl.h",
  28. "local_device_info_util.cc",
  29. "local_device_info_util.h",
  30. ]
  31. configs += [ "//build/config:precompiled_headers" ]
  32. public_deps = [
  33. "//base",
  34. "//components/sync",
  35. "//components/sync/invalidations",
  36. "//components/sync/protocol",
  37. ]
  38. deps = [
  39. "//build:chromeos_buildflags",
  40. "//components/keyed_service/core",
  41. "//components/metrics",
  42. "//components/prefs",
  43. "//components/version_info",
  44. "//ui/base",
  45. ]
  46. configs += [ "//build/config/compiler:wexit_time_destructors" ]
  47. if (is_android) {
  48. sources += [ "local_device_info_util_android.cc" ]
  49. }
  50. if (is_chromeos) {
  51. sources += [ "local_device_info_util_chromeos.cc" ]
  52. }
  53. if (is_ios) {
  54. sources += [ "local_device_info_util_ios.mm" ]
  55. }
  56. if (is_linux) {
  57. sources += [ "local_device_info_util_linux.cc" ]
  58. }
  59. if (is_fuchsia) {
  60. sources += [ "local_device_info_util_fuchsia.cc" ]
  61. }
  62. if (is_mac) {
  63. sources += [ "local_device_info_util_mac.mm" ]
  64. frameworks = [
  65. "CoreFoundation.framework",
  66. "SystemConfiguration.framework", # For local_device_info_util_mac.mm.
  67. ]
  68. }
  69. if (is_win) {
  70. sources += [ "local_device_info_util_win.cc" ]
  71. }
  72. if (is_chromeos) {
  73. deps += [
  74. "//chromeos/constants",
  75. "//chromeos/system",
  76. ]
  77. }
  78. }
  79. static_library("test_support") {
  80. testonly = true
  81. sources = [
  82. "fake_device_info_sync_service.cc",
  83. "fake_device_info_sync_service.h",
  84. "fake_device_info_tracker.cc",
  85. "fake_device_info_tracker.h",
  86. "fake_local_device_info_provider.cc",
  87. "fake_local_device_info_provider.h",
  88. ]
  89. public_deps = [ ":sync_device_info" ]
  90. deps = [ "//components/sync:test_support" ]
  91. }
  92. source_set("unit_tests") {
  93. testonly = true
  94. sources = [
  95. "device_count_metrics_provider_unittest.cc",
  96. "device_info_prefs_unittest.cc",
  97. "device_info_sync_bridge_unittest.cc",
  98. "device_info_util_unittest.cc",
  99. "local_device_info_provider_impl_unittest.cc",
  100. "local_device_info_util_unittest.cc",
  101. ]
  102. configs += [ "//build/config:precompiled_headers" ]
  103. deps = [
  104. ":sync_device_info",
  105. ":test_support",
  106. "//base",
  107. "//base/test:test_support",
  108. "//build:chromeos_buildflags",
  109. "//components/prefs:test_support",
  110. "//components/sync:test_support",
  111. "//components/version_info:version_string",
  112. "//testing/gmock",
  113. "//testing/gtest",
  114. ]
  115. if (is_chromeos_ash) {
  116. deps += [ "//chromeos/system" ]
  117. }
  118. }