BUCK 2.3 KB

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