BUCK 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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 = "imagemanager",
  18. srcs = glob(
  19. [
  20. "*.cpp",
  21. ],
  22. exclude = glob(["tests/**/*.cpp"]),
  23. ),
  24. header_namespace = "",
  25. compiler_flags = [
  26. "-fexceptions",
  27. "-frtti",
  28. "-std=c++14",
  29. "-Wall",
  30. ],
  31. contacts = ["oncall+react_native@xmail.facebook.com"],
  32. fbandroid_exported_headers = subdir_glob(
  33. [
  34. ("", "*.h"),
  35. ("platform/cxx", "**/*.h"),
  36. ],
  37. prefix = "react/imagemanager",
  38. ),
  39. fbandroid_headers = subdir_glob(
  40. [
  41. ("", "*.h"),
  42. ("platform/cxx", "**/*.h"),
  43. ],
  44. prefix = "",
  45. ),
  46. fbandroid_srcs = glob(
  47. [
  48. "platform/cxx/**/*.cpp",
  49. ],
  50. ),
  51. fbobjc_compiler_flags = APPLE_COMPILER_FLAGS,
  52. fbobjc_labels = ["supermodule:ios/default/public.react_native.infra"],
  53. fbobjc_preprocessor_flags = get_preprocessor_flags_for_build_mode() + get_apple_inspector_flags() + [
  54. "-DLOG_TAG=\"ReactNative\"",
  55. "-DWITH_FBSYSTRACE=1",
  56. ],
  57. force_static = True,
  58. ios_deps = [
  59. "//xplat/js:RCTImage",
  60. "//xplat/js/react-native-github:RCTCxxBridge",
  61. ],
  62. ios_exported_headers = subdir_glob(
  63. [
  64. ("", "*.h"),
  65. ("platform/ios", "RCTImageInstrumentationProxy.h"),
  66. ("platform/ios", "RCTImagePrimitivesConversions.h"),
  67. ],
  68. prefix = "react/imagemanager",
  69. ),
  70. ios_frameworks = [
  71. "$SDKROOT/System/Library/Frameworks/CoreGraphics.framework",
  72. "$SDKROOT/System/Library/Frameworks/Foundation.framework",
  73. "$SDKROOT/System/Library/Frameworks/UIKit.framework",
  74. ],
  75. ios_headers = subdir_glob(
  76. [
  77. ("", "*.h"),
  78. ("platform/ios", "**/*.h"),
  79. ],
  80. prefix = "",
  81. ),
  82. ios_srcs = glob(
  83. [
  84. "platform/ios/**/*.cpp",
  85. "platform/ios/**/*.mm",
  86. ],
  87. ),
  88. macosx_tests_override = [],
  89. platforms = (ANDROID, APPLE, CXX),
  90. preprocessor_flags = [
  91. "-DLOG_TAG=\"ReactNative\"",
  92. "-DWITH_FBSYSTRACE=1",
  93. ],
  94. tests = [":tests"],
  95. visibility = ["PUBLIC"],
  96. deps = [
  97. "//xplat/fbsystrace:fbsystrace",
  98. "//xplat/folly:headers_only",
  99. "//xplat/folly:memory",
  100. "//xplat/folly:molly",
  101. "//xplat/third-party/glog:glog",
  102. YOGA_CXX_TARGET,
  103. react_native_xplat_target("fabric/core:core"),
  104. react_native_xplat_target("fabric/mounting:mounting"),
  105. react_native_xplat_target("fabric/debug:debug"),
  106. react_native_xplat_target("fabric/graphics:graphics"),
  107. ],
  108. )
  109. fb_xplat_cxx_test(
  110. name = "tests",
  111. srcs = glob(["tests/**/*.cpp"]),
  112. headers = glob(["tests/**/*.h"]),
  113. compiler_flags = [
  114. "-fexceptions",
  115. "-frtti",
  116. "-std=c++14",
  117. "-Wall",
  118. ],
  119. contacts = ["oncall+react_native@xmail.facebook.com"],
  120. platforms = (ANDROID, APPLE, CXX),
  121. deps = [
  122. ":imagemanager",
  123. "//xplat/folly:molly",
  124. "//xplat/third-party/gmock:gtest",
  125. ],
  126. )