BUILD.gn 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. # Copyright 2014 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/symlink.gni")
  5. import("//testing/test.gni")
  6. group("forwarder2") {
  7. testonly = true
  8. data_deps = [
  9. ":device_forwarder_prepare_dist($default_toolchain)",
  10. ":host_forwarder",
  11. ":host_forwarder_unittests",
  12. ]
  13. }
  14. if (current_toolchain == default_toolchain) {
  15. import("//build/config/android/rules.gni")
  16. executable("device_forwarder") {
  17. sources = [
  18. "command.cc",
  19. "command.h",
  20. "common.cc",
  21. "common.h",
  22. "daemon.cc",
  23. "daemon.h",
  24. "device_controller.cc",
  25. "device_controller.h",
  26. "device_forwarder_main.cc",
  27. "device_listener.cc",
  28. "device_listener.h",
  29. "forwarder.cc",
  30. "forwarder.h",
  31. "forwarders_manager.cc",
  32. "forwarders_manager.h",
  33. "pipe_notifier.cc",
  34. "pipe_notifier.h",
  35. "self_deleter_helper.h",
  36. "socket.cc",
  37. "socket.h",
  38. "util.h",
  39. ]
  40. deps = [
  41. "//base",
  42. "//tools/android/common",
  43. ]
  44. data_deps = [ "//build/android/pylib/device/commands" ]
  45. }
  46. create_native_executable_dist("device_forwarder_prepare_dist") {
  47. dist_dir = "$root_build_dir/forwarder_dist"
  48. binary = "$root_build_dir/device_forwarder"
  49. deps = [ ":device_forwarder" ]
  50. }
  51. }
  52. if (current_toolchain != default_toolchain) {
  53. source_set("host_forwarder_source_set") {
  54. sources = [
  55. "command.cc",
  56. "command.h",
  57. "common.cc",
  58. "common.h",
  59. "daemon.cc",
  60. "daemon.h",
  61. "forwarder.cc",
  62. "forwarder.h",
  63. "forwarders_manager.cc",
  64. "forwarders_manager.h",
  65. "host_controller.cc",
  66. "host_controller.h",
  67. "host_controllers_manager.cc",
  68. "host_controllers_manager.h",
  69. "pipe_notifier.cc",
  70. "pipe_notifier.h",
  71. "self_deleter_helper.h",
  72. "socket.cc",
  73. "socket.h",
  74. "util.h",
  75. ]
  76. deps = [
  77. "//base",
  78. "//tools/android/common",
  79. ]
  80. }
  81. executable("host_forwarder") {
  82. sources = [ "host_forwarder_main.cc" ]
  83. deps = [
  84. ":host_forwarder_source_set",
  85. "//base",
  86. ]
  87. }
  88. test("host_forwarder_unittests") {
  89. testonly = true
  90. sources = [ "host_controllers_manager_unittest.cc" ]
  91. deps = [
  92. ":host_forwarder_source_set",
  93. "//base",
  94. "//testing/gtest",
  95. "//testing/gtest:gtest_main",
  96. ]
  97. }
  98. } else {
  99. # Create a symlink from root_build_dir -> clang_x64/host_forwarder.
  100. binary_symlink("host_forwarder") {
  101. binary_label = ":$target_name($host_toolchain)"
  102. }
  103. binary_symlink("host_forwarder_unittests") {
  104. testonly = true
  105. binary_label = ":$target_name($host_toolchain)"
  106. }
  107. }