BUCK 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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_target",
  12. "react_native_xplat_target",
  13. "rn_xplat_cxx_library",
  14. "subdir_glob",
  15. )
  16. APPLE_COMPILER_FLAGS = get_apple_compiler_flags()
  17. rn_xplat_cxx_library(
  18. name = "slider",
  19. srcs = glob(
  20. ["**/*.cpp"],
  21. exclude = glob([
  22. "tests/**/*.cpp",
  23. "platform/**/*.cpp",
  24. ]),
  25. ),
  26. headers = [],
  27. header_namespace = "",
  28. exported_headers = subdir_glob(
  29. [
  30. ("", "*.h"),
  31. ],
  32. prefix = "react/components/slider",
  33. ),
  34. compiler_flags = [
  35. "-fexceptions",
  36. "-frtti",
  37. "-std=c++14",
  38. "-Wall",
  39. ],
  40. cxx_tests = [":tests"],
  41. fbandroid_deps = [
  42. react_native_target("jni/react/jni:jni"),
  43. ],
  44. fbandroid_exported_headers = subdir_glob(
  45. [
  46. ("", "*.h"),
  47. ("platform/android", "*.h"),
  48. ],
  49. prefix = "react/components/slider",
  50. ),
  51. fbandroid_headers = glob(
  52. ["platform/android/*.h"],
  53. ),
  54. fbandroid_srcs = glob(
  55. ["platform/android/*.cpp"],
  56. ),
  57. fbobjc_compiler_flags = APPLE_COMPILER_FLAGS,
  58. fbobjc_labels = ["supermodule:ios/default/public.react_native.infra"],
  59. fbobjc_preprocessor_flags = get_preprocessor_flags_for_build_mode() + get_apple_inspector_flags(),
  60. force_static = True,
  61. ios_exported_headers = subdir_glob(
  62. [
  63. ("", "*.h"),
  64. ("platform/ios", "*.h"),
  65. ],
  66. prefix = "react/components/slider",
  67. ),
  68. ios_headers = glob(
  69. ["platform/ios/*.h"],
  70. ),
  71. ios_srcs = glob(
  72. ["platform/ios/*.cpp"],
  73. ),
  74. platforms = (ANDROID, APPLE, CXX),
  75. preprocessor_flags = [
  76. "-DLOG_TAG=\"ReactNative\"",
  77. "-DWITH_FBSYSTRACE=1",
  78. ],
  79. visibility = ["PUBLIC"],
  80. deps = [
  81. "//xplat/fbsystrace:fbsystrace",
  82. "//xplat/folly:headers_only",
  83. "//xplat/folly:memory",
  84. "//xplat/folly:molly",
  85. "//xplat/third-party/glog:glog",
  86. YOGA_CXX_TARGET,
  87. react_native_xplat_target("fabric/debug:debug"),
  88. react_native_xplat_target("fabric/core:core"),
  89. react_native_xplat_target("fabric/components/image:image"),
  90. react_native_xplat_target("fabric/components/view:view"),
  91. react_native_xplat_target("fabric/graphics:graphics"),
  92. react_native_xplat_target("fabric/imagemanager:imagemanager"),
  93. react_native_xplat_target("fabric/uimanager:uimanager"),
  94. "//xplat/js/react-native-github:generated_components-rncore",
  95. ],
  96. )
  97. fb_xplat_cxx_test(
  98. name = "tests",
  99. srcs = glob(["tests/**/*.cpp"]),
  100. headers = glob(["tests/**/*.h"]),
  101. compiler_flags = [
  102. "-fexceptions",
  103. "-frtti",
  104. "-std=c++14",
  105. "-Wall",
  106. ],
  107. contacts = ["oncall+react_native@xmail.facebook.com"],
  108. platforms = (
  109. # `Apple` and `Android` flavors are disabled because the module (built with those flavors) requires Emulator/Simulator (which is expensive and slow). At the same time, we don't really have tests here.
  110. # ANDROID,
  111. # APPLE,
  112. CXX,
  113. ),
  114. deps = [
  115. ":slider",
  116. "//xplat/folly:molly",
  117. "//xplat/third-party/gmock:gtest",
  118. ],
  119. )