BUCK 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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 = "modal",
  18. srcs = glob(
  19. ["**/*.cpp"],
  20. exclude = glob([
  21. "tests/**/*.cpp",
  22. "platform/**/*.cpp",
  23. ]),
  24. ),
  25. headers = [],
  26. header_namespace = "",
  27. exported_headers = subdir_glob(
  28. [
  29. ("", "*.h"),
  30. ],
  31. prefix = "react/components/modal",
  32. ),
  33. compiler_flags = [
  34. "-fexceptions",
  35. "-frtti",
  36. "-std=c++14",
  37. "-Wall",
  38. ],
  39. fbandroid_exported_headers = subdir_glob(
  40. [
  41. ("", "*.h"),
  42. ("platform/android", "*.h"),
  43. ],
  44. prefix = "react/components/modal",
  45. ),
  46. fbandroid_headers = glob(
  47. ["platform/android/*.h"],
  48. ),
  49. fbandroid_srcs = glob(
  50. ["platform/android/*.cpp"],
  51. ),
  52. fbobjc_compiler_flags = APPLE_COMPILER_FLAGS,
  53. fbobjc_labels = ["supermodule:ios/default/public.react_native.infra"],
  54. fbobjc_preprocessor_flags = get_preprocessor_flags_for_build_mode() + get_apple_inspector_flags(),
  55. force_static = True,
  56. ios_exported_headers = subdir_glob(
  57. [
  58. ("", "*.h"),
  59. ("platform/ios", "*.h"),
  60. ],
  61. prefix = "react/components/modal",
  62. ),
  63. macosx_tests_override = [],
  64. platforms = (ANDROID, APPLE, CXX),
  65. preprocessor_flags = [
  66. "-DLOG_TAG=\"ReactNative\"",
  67. "-DWITH_FBSYSTRACE=1",
  68. ],
  69. tests = [":tests"],
  70. visibility = ["PUBLIC"],
  71. deps = [
  72. "//xplat/fbsystrace:fbsystrace",
  73. "//xplat/folly:headers_only",
  74. "//xplat/folly:memory",
  75. "//xplat/folly:molly",
  76. "//xplat/third-party/glog:glog",
  77. YOGA_CXX_TARGET,
  78. react_native_xplat_target("fabric/debug:debug"),
  79. react_native_xplat_target("fabric/core:core"),
  80. react_native_xplat_target("fabric/components/image:image"),
  81. react_native_xplat_target("fabric/components/view:view"),
  82. react_native_xplat_target("fabric/graphics:graphics"),
  83. react_native_xplat_target("fabric/imagemanager:imagemanager"),
  84. react_native_xplat_target("fabric/uimanager:uimanager"),
  85. "//xplat/js/react-native-github:generated_components-rncore",
  86. ],
  87. )
  88. fb_xplat_cxx_test(
  89. name = "tests",
  90. srcs = glob(["tests/**/*.cpp"]),
  91. headers = glob(["tests/**/*.h"]),
  92. compiler_flags = [
  93. "-fexceptions",
  94. "-frtti",
  95. "-std=c++14",
  96. "-Wall",
  97. ],
  98. contacts = ["oncall+react_native@xmail.facebook.com"],
  99. platforms = (ANDROID, APPLE, CXX),
  100. deps = [
  101. ":modal",
  102. "//xplat/folly:molly",
  103. "//xplat/third-party/gmock:gtest",
  104. ],
  105. )