BUILD.gn 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  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/chromecast_build.gni")
  5. if (is_android) {
  6. import("//build/config/android/rules.gni")
  7. }
  8. static_library("quarantine") {
  9. sources = [
  10. "quarantine.cc",
  11. "quarantine.h",
  12. "quarantine_impl.cc",
  13. "quarantine_impl.h",
  14. ]
  15. public_deps = [ "//components/services/quarantine/public/mojom" ]
  16. deps = [
  17. ":common",
  18. "//base",
  19. "//net",
  20. "//url",
  21. ]
  22. if (is_win) {
  23. sources += [ "quarantine_win.cc" ]
  24. }
  25. if (is_mac) {
  26. sources += [ "quarantine_mac.mm" ]
  27. frameworks = [
  28. "Carbon.framework",
  29. "Foundation.framework",
  30. ]
  31. }
  32. if (is_chromeos) {
  33. sources += [ "quarantine_chromeos.cc" ]
  34. deps += [
  35. "//chromeos/dbus/dlp",
  36. "//chromeos/dbus/dlp:dlp_proto",
  37. ]
  38. }
  39. }
  40. source_set("common") {
  41. sources = [
  42. "common.cc",
  43. "common.h",
  44. ]
  45. deps = [
  46. "//base",
  47. "//url",
  48. ]
  49. if (is_win) {
  50. sources += [
  51. "common_win.cc",
  52. "common_win.h",
  53. ]
  54. }
  55. if (is_mac) {
  56. sources += [
  57. "common_mac.h",
  58. "common_mac.mm",
  59. ]
  60. frameworks = [
  61. "Carbon.framework",
  62. "Foundation.framework",
  63. ]
  64. }
  65. }
  66. source_set("test_support") {
  67. testonly = true
  68. sources = [
  69. "test_support.cc",
  70. "test_support.h",
  71. ]
  72. deps = [
  73. ":common",
  74. ":quarantine",
  75. "//base",
  76. "//url",
  77. ]
  78. if (is_win) {
  79. sources += [ "test_support_win.cc" ]
  80. }
  81. if (is_mac) {
  82. sources += [ "test_support_mac.mm" ]
  83. frameworks = [
  84. "Carbon.framework",
  85. "Foundation.framework",
  86. ]
  87. }
  88. }
  89. source_set("unit_tests") {
  90. testonly = true
  91. sources = [
  92. "common_unittests.cc",
  93. "quarantine_service_unittest.cc",
  94. ]
  95. # Chromecasts do not have extended attributes enabled; even if it were
  96. # enabled, the devices use tmpfs which restricts the extended attributes that
  97. # can be set such that quarantining still would not work. (The platform
  98. # specific tests include a runtime guard to skip tests that need xattr.)
  99. if (!is_castos && !is_cast_android) {
  100. sources += [ "quarantine_unittest.cc" ]
  101. }
  102. deps = [
  103. ":common",
  104. ":quarantine",
  105. ":test_support",
  106. "//base",
  107. "//base/test:test_support",
  108. "//components/services/quarantine/public/mojom",
  109. "//net",
  110. "//testing/gmock",
  111. "//testing/gtest",
  112. "//url",
  113. ]
  114. if (is_win) {
  115. sources += [ "quarantine_win_unittest.cc" ]
  116. }
  117. if (is_mac) {
  118. sources += [ "quarantine_mac_unittest.mm" ]
  119. frameworks = [
  120. "Carbon.framework",
  121. "Foundation.framework",
  122. ]
  123. }
  124. }