BUCK 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. load("@fbsource//tools/build_defs/apple:flag_defs.bzl", "get_preprocessor_flags_for_build_mode")
  2. load(
  3. "//tools/build_defs/oss:rn_defs.bzl",
  4. "ANDROID",
  5. "APPLE",
  6. "CXX",
  7. "YOGA_CXX_TARGET",
  8. "fb_xplat_cxx_test",
  9. "get_apple_compiler_flags",
  10. "get_apple_inspector_flags",
  11. "react_native_xplat_target",
  12. "rn_xplat_cxx_library",
  13. "subdir_glob",
  14. )
  15. APPLE_COMPILER_FLAGS = get_apple_compiler_flags()
  16. rn_xplat_cxx_library(
  17. name = "scrollview",
  18. srcs = glob(
  19. ["**/*.cpp"],
  20. exclude = glob(["tests/**/*.cpp"]),
  21. ),
  22. headers = glob(
  23. ["**/*.h"],
  24. exclude = glob(["tests/**/*.h"]),
  25. ),
  26. header_namespace = "",
  27. exported_headers = subdir_glob(
  28. [
  29. ("", "*.h"),
  30. ],
  31. prefix = "react/components/scrollview",
  32. ),
  33. compiler_flags = [
  34. "-fexceptions",
  35. "-frtti",
  36. "-std=c++14",
  37. "-Wall",
  38. ],
  39. fbobjc_compiler_flags = APPLE_COMPILER_FLAGS,
  40. fbobjc_labels = ["supermodule:ios/default/public.react_native.infra"],
  41. fbobjc_preprocessor_flags = get_preprocessor_flags_for_build_mode() + get_apple_inspector_flags(),
  42. force_static = True,
  43. macosx_tests_override = [],
  44. platforms = (ANDROID, APPLE, CXX),
  45. preprocessor_flags = [
  46. "-DLOG_TAG=\"ReactNative\"",
  47. "-DWITH_FBSYSTRACE=1",
  48. ],
  49. tests = [":tests"],
  50. visibility = ["PUBLIC"],
  51. deps = [
  52. "//xplat/fbsystrace:fbsystrace",
  53. "//xplat/folly:headers_only",
  54. "//xplat/folly:memory",
  55. "//xplat/folly:molly",
  56. "//xplat/third-party/glog:glog",
  57. YOGA_CXX_TARGET,
  58. react_native_xplat_target("fabric/debug:debug"),
  59. react_native_xplat_target("fabric/core:core"),
  60. react_native_xplat_target("fabric/graphics:graphics"),
  61. react_native_xplat_target("fabric/components/view:view"),
  62. ],
  63. )
  64. fb_xplat_cxx_test(
  65. name = "tests",
  66. srcs = glob(["tests/**/*.cpp"]),
  67. headers = glob(["tests/**/*.h"]),
  68. compiler_flags = [
  69. "-fexceptions",
  70. "-frtti",
  71. "-std=c++14",
  72. "-Wall",
  73. ],
  74. contacts = ["oncall+react_native@xmail.facebook.com"],
  75. platforms = (ANDROID, APPLE, CXX),
  76. deps = [
  77. ":scrollview",
  78. "//xplat/folly:molly",
  79. "//xplat/third-party/gmock:gtest",
  80. ],
  81. )