BUCK 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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. "fb_xplat_cxx_test",
  8. "get_apple_compiler_flags",
  9. "get_apple_inspector_flags",
  10. "react_native_xplat_target",
  11. "rn_xplat_cxx_library",
  12. "subdir_glob",
  13. )
  14. APPLE_COMPILER_FLAGS = get_apple_compiler_flags()
  15. rn_xplat_cxx_library(
  16. name = "uimanager",
  17. srcs = glob(
  18. ["**/*.cpp"],
  19. exclude = glob(["tests/**/*.cpp"]),
  20. ),
  21. headers = glob(
  22. ["**/*.h"],
  23. exclude = glob(["tests/**/*.h"]),
  24. ),
  25. header_namespace = "",
  26. exported_headers = subdir_glob(
  27. [
  28. ("", "*.h"),
  29. ],
  30. prefix = "react/uimanager",
  31. ),
  32. compiler_flags = [
  33. "-fexceptions",
  34. "-frtti",
  35. "-std=c++14",
  36. "-Wall",
  37. ],
  38. fbobjc_compiler_flags = APPLE_COMPILER_FLAGS,
  39. fbobjc_labels = ["supermodule:ios/default/public.react_native.infra"],
  40. fbobjc_preprocessor_flags = get_preprocessor_flags_for_build_mode() + get_apple_inspector_flags(),
  41. force_static = True,
  42. macosx_tests_override = [],
  43. platforms = (ANDROID, APPLE, CXX),
  44. preprocessor_flags = [
  45. "-DLOG_TAG=\"ReactNative\"",
  46. "-DWITH_FBSYSTRACE=1",
  47. ],
  48. tests = [":tests"],
  49. visibility = ["PUBLIC"],
  50. deps = [
  51. "//xplat/fbsystrace:fbsystrace",
  52. "//xplat/folly:headers_only",
  53. "//xplat/folly:memory",
  54. "//xplat/folly:molly",
  55. "//xplat/jsi:JSIDynamic",
  56. "//xplat/jsi:jsi",
  57. "//xplat/third-party/glog:glog",
  58. react_native_xplat_target("config:config"),
  59. react_native_xplat_target("fabric/components/view:view"),
  60. react_native_xplat_target("fabric/mounting:mounting"),
  61. react_native_xplat_target("fabric/core:core"),
  62. react_native_xplat_target("fabric/debug:debug"),
  63. react_native_xplat_target("utils:utils"),
  64. ],
  65. )
  66. fb_xplat_cxx_test(
  67. name = "tests",
  68. srcs = glob(["tests/**/*.cpp"]),
  69. headers = glob(["tests/**/*.h"]),
  70. compiler_flags = [
  71. "-fexceptions",
  72. "-frtti",
  73. "-std=c++14",
  74. "-Wall",
  75. ],
  76. contacts = ["oncall+react_native@xmail.facebook.com"],
  77. platforms = (ANDROID, APPLE, CXX),
  78. deps = [
  79. ":uimanager",
  80. "//xplat/folly:molly",
  81. "//xplat/third-party/gmock:gtest",
  82. react_native_xplat_target("config:config"),
  83. react_native_xplat_target("fabric/components/activityindicator:activityindicator"),
  84. react_native_xplat_target("fabric/components/image:image"),
  85. react_native_xplat_target("fabric/components/root:root"),
  86. react_native_xplat_target("fabric/components/scrollview:scrollview"),
  87. react_native_xplat_target("fabric/components/view:view"),
  88. "//xplat/js/react-native-github:generated_components-rncore",
  89. ],
  90. )