BUCK 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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 = "mounting",
  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. ("stubs", "*.h"),
  30. ],
  31. prefix = "react/mounting",
  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. react_native_xplat_target("better:better"),
  58. react_native_xplat_target("fabric/components/root:root"),
  59. react_native_xplat_target("fabric/components/view:view"),
  60. react_native_xplat_target("fabric/core:core"),
  61. react_native_xplat_target("fabric/debug:debug"),
  62. react_native_xplat_target("utils:utils"),
  63. ],
  64. )
  65. fb_xplat_cxx_test(
  66. name = "tests",
  67. srcs = glob(["tests/**/*.cpp"]),
  68. headers = glob(["tests/**/*.h"]),
  69. compiler_flags = [
  70. "-fexceptions",
  71. "-frtti",
  72. "-std=c++14",
  73. "-Wall",
  74. ],
  75. contacts = ["oncall+react_native@xmail.facebook.com"],
  76. platforms = (ANDROID, APPLE, CXX),
  77. deps = [
  78. ":mounting",
  79. "//xplat/folly:molly",
  80. "//xplat/third-party/gmock:gtest",
  81. ],
  82. )