BUCK 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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 = "root",
  18. srcs = glob(
  19. ["**/*.cpp"],
  20. exclude = glob(["tests/**/*.cpp"]),
  21. ),
  22. headers = [],
  23. header_namespace = "",
  24. exported_headers = subdir_glob(
  25. [
  26. ("", "*.h"),
  27. ],
  28. prefix = "react/components/root",
  29. ),
  30. compiler_flags = [
  31. "-fexceptions",
  32. "-frtti",
  33. "-std=c++14",
  34. "-Wall",
  35. ],
  36. fbobjc_compiler_flags = APPLE_COMPILER_FLAGS,
  37. fbobjc_labels = ["supermodule:ios/default/public.react_native.infra"],
  38. fbobjc_preprocessor_flags = get_preprocessor_flags_for_build_mode() + get_apple_inspector_flags(),
  39. macosx_tests_override = [],
  40. platforms = (ANDROID, APPLE, CXX),
  41. preprocessor_flags = [
  42. "-DLOG_TAG=\"ReactNative\"",
  43. "-DWITH_FBSYSTRACE=1",
  44. ],
  45. tests = [":tests"],
  46. visibility = ["PUBLIC"],
  47. deps = [
  48. "//xplat/fbsystrace:fbsystrace",
  49. "//xplat/folly:headers_only",
  50. "//xplat/folly:memory",
  51. "//xplat/folly:molly",
  52. "//xplat/third-party/glog:glog",
  53. YOGA_CXX_TARGET,
  54. react_native_xplat_target("fabric/debug:debug"),
  55. react_native_xplat_target("fabric/core:core"),
  56. react_native_xplat_target("fabric/graphics:graphics"),
  57. react_native_xplat_target("fabric/components/view:view"),
  58. ],
  59. )
  60. fb_xplat_cxx_test(
  61. name = "tests",
  62. srcs = glob(["tests/**/*.cpp"]),
  63. headers = glob(["tests/**/*.h"]),
  64. compiler_flags = [
  65. "-fexceptions",
  66. "-frtti",
  67. "-std=c++14",
  68. "-Wall",
  69. ],
  70. contacts = ["oncall+react_native@xmail.facebook.com"],
  71. platforms = (ANDROID, APPLE, CXX),
  72. deps = [
  73. ":root",
  74. "//xplat/folly:molly",
  75. "//xplat/third-party/gmock:gtest",
  76. ],
  77. )