BUILD.gn 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. # Copyright 2015 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. static_library("open_from_clipboard") {
  5. sources = [
  6. "clipboard_recent_content.cc",
  7. "clipboard_recent_content.h",
  8. ]
  9. deps = [
  10. ":open_from_clipboard_impl",
  11. "//base",
  12. "//components/variations",
  13. "//net",
  14. "//ui/base:base",
  15. "//url",
  16. ]
  17. if (!is_ios) {
  18. sources += [
  19. "clipboard_recent_content_generic.cc",
  20. "clipboard_recent_content_generic.h",
  21. ]
  22. deps += [ "//ui/base/clipboard" ]
  23. } else {
  24. sources += [
  25. "clipboard_recent_content_ios.h",
  26. "clipboard_recent_content_ios.mm",
  27. ]
  28. configs += [ "//build/config/compiler:enable_arc" ]
  29. }
  30. }
  31. # Helper classes used by "open_from_clipboard" target. These classes must have
  32. # no dependencies on "//base:i18n".
  33. source_set("open_from_clipboard_impl") {
  34. sources = []
  35. deps = [ "//base" ]
  36. assert_no_deps = [ "//base:i18n" ]
  37. if (is_ios) {
  38. sources += [
  39. "clipboard_recent_content_impl_ios.h",
  40. "clipboard_recent_content_impl_ios.mm",
  41. ]
  42. configs += [ "//build/config/compiler:enable_arc" ]
  43. frameworks = [ "MobileCoreServices.framework" ]
  44. }
  45. }
  46. static_library("test_support") {
  47. testonly = true
  48. sources = [
  49. "fake_clipboard_recent_content.cc",
  50. "fake_clipboard_recent_content.h",
  51. ]
  52. deps = [
  53. ":open_from_clipboard",
  54. "//base",
  55. "//ui/gfx:gfx",
  56. "//url",
  57. ]
  58. }
  59. source_set("unit_tests") {
  60. testonly = true
  61. sources = []
  62. deps = [
  63. ":open_from_clipboard",
  64. ":open_from_clipboard_impl",
  65. "//base",
  66. "//base/test:test_support",
  67. "//testing/gtest",
  68. "//ui/base:test_support",
  69. "//ui/gfx:test_support",
  70. "//url",
  71. ]
  72. if (!is_ios) {
  73. sources += [ "clipboard_recent_content_generic_unittest.cc" ]
  74. deps += [
  75. "//base/test:test_support",
  76. "//ui/base/clipboard:clipboard_test_support",
  77. ]
  78. } else {
  79. sources += [ "clipboard_recent_content_ios_unittest.mm" ]
  80. configs += [ "//build/config/compiler:enable_arc" ]
  81. }
  82. }