BUCK 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  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 = "textlayoutmanager",
  19. srcs = glob(
  20. [
  21. "*.cpp",
  22. ],
  23. ),
  24. headers = subdir_glob(
  25. [
  26. ("", "*.h"),
  27. ],
  28. prefix = "",
  29. ),
  30. header_namespace = "",
  31. exported_headers = subdir_glob(
  32. [
  33. ("", "*.h"),
  34. ],
  35. prefix = "react/textlayoutmanager",
  36. ),
  37. compiler_flags = [
  38. "-fexceptions",
  39. "-frtti",
  40. "-std=c++14",
  41. "-Wall",
  42. ],
  43. cxx_exported_headers = subdir_glob(
  44. [
  45. ("platform/cxx", "*.h"),
  46. ],
  47. prefix = "react/textlayoutmanager",
  48. ),
  49. cxx_headers = subdir_glob(
  50. [
  51. ("platform/cxx", "**/*.h"),
  52. ],
  53. prefix = "",
  54. ),
  55. cxx_srcs = glob(
  56. [
  57. "platform/cxx/**/*.cpp",
  58. ],
  59. ),
  60. cxx_tests = [":tests"],
  61. fbandroid_deps = [
  62. react_native_target("jni/react/jni:jni"),
  63. ],
  64. fbandroid_exported_headers = subdir_glob(
  65. [
  66. ("platform/android", "*.h"),
  67. ],
  68. prefix = "react/textlayoutmanager",
  69. ),
  70. fbandroid_headers = subdir_glob(
  71. [
  72. ("platform/android", "**/*.h"),
  73. ],
  74. prefix = "",
  75. ),
  76. fbandroid_srcs = glob(
  77. [
  78. "platform/android/**/*.cpp",
  79. ],
  80. ),
  81. fbobjc_compiler_flags = APPLE_COMPILER_FLAGS,
  82. fbobjc_labels = ["supermodule:ios/default/public.react_native.infra"],
  83. fbobjc_preprocessor_flags = get_preprocessor_flags_for_build_mode() + get_apple_inspector_flags(),
  84. force_static = True,
  85. ios_deps = [
  86. ],
  87. ios_exported_headers = subdir_glob(
  88. [
  89. ("platform/ios", "*.h"),
  90. ],
  91. prefix = "react/textlayoutmanager",
  92. ),
  93. ios_frameworks = [
  94. "$SDKROOT/System/Library/Frameworks/CoreGraphics.framework",
  95. "$SDKROOT/System/Library/Frameworks/Foundation.framework",
  96. "$SDKROOT/System/Library/Frameworks/UIKit.framework",
  97. ],
  98. ios_headers = subdir_glob(
  99. [
  100. ("platform/ios", "**/*.h"),
  101. ],
  102. prefix = "",
  103. ),
  104. ios_srcs = glob(
  105. [
  106. "platform/ios/**/*.cpp",
  107. "platform/ios/**/*.mm",
  108. ],
  109. ),
  110. macosx_tests_override = [],
  111. platforms = (ANDROID, APPLE, CXX),
  112. preprocessor_flags = [
  113. "-DLOG_TAG=\"ReactNative\"",
  114. "-DWITH_FBSYSTRACE=1",
  115. ],
  116. visibility = ["PUBLIC"],
  117. deps = [
  118. "//xplat/fbsystrace:fbsystrace",
  119. "//xplat/folly:headers_only",
  120. "//xplat/folly:memory",
  121. "//xplat/folly:molly",
  122. "//xplat/third-party/glog:glog",
  123. YOGA_CXX_TARGET,
  124. react_native_xplat_target("fabric/attributedstring:attributedstring"),
  125. react_native_xplat_target("fabric/core:core"),
  126. react_native_xplat_target("utils:utils"),
  127. react_native_xplat_target("fabric/debug:debug"),
  128. react_native_xplat_target("fabric/graphics:graphics"),
  129. react_native_xplat_target("fabric/uimanager:uimanager"),
  130. ],
  131. )
  132. fb_xplat_cxx_test(
  133. name = "tests",
  134. srcs = glob(["tests/**/*.cpp"]),
  135. headers = glob(["tests/**/*.h"]),
  136. compiler_flags = [
  137. "-fexceptions",
  138. "-frtti",
  139. "-std=c++14",
  140. "-Wall",
  141. ],
  142. contacts = ["oncall+react_native@xmail.facebook.com"],
  143. platforms = (
  144. # `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.
  145. # ANDROID,
  146. # APPLE,
  147. CXX,
  148. ),
  149. deps = [
  150. ":textlayoutmanager",
  151. "//xplat/folly:molly",
  152. "//xplat/third-party/gmock:gtest",
  153. ],
  154. )