|
| 1 | +load("//configurations/buck/apple:flag_defs.bzl", "get_application_ios_flags", "get_debug_preprocessor_flags", "OBJC_ARC_PREPROCESSOR_FLAGS") |
| 2 | +load("//ReactNative:DEFS.bzl", "IS_OSS_BUILD", "rn_xplat_cxx_library", "get_apple_inspector_flags", "react_native_xplat_target", "ANDROID", "APPLE") |
| 3 | + |
| 4 | +APPLE_COMPILER_FLAGS = [] |
| 5 | + |
| 6 | +if not IS_OSS_BUILD: |
| 7 | + load("@xplat//configurations/buck/apple:flag_defs.bzl", "get_static_library_ios_flags", "flags") |
| 8 | + APPLE_COMPILER_FLAGS = flags.get_flag_value(get_static_library_ios_flags(), 'compiler_flags') |
| 9 | + |
| 10 | +rn_xplat_cxx_library( |
| 11 | + name = "scrollview", |
| 12 | + srcs = glob( |
| 13 | + ["**/*.cpp"], |
| 14 | + excludes = glob(["tests/**/*.cpp"]), |
| 15 | + ), |
| 16 | + headers = glob( |
| 17 | + ["**/*.h"], |
| 18 | + excludes = glob(["tests/**/*.h"]), |
| 19 | + ), |
| 20 | + header_namespace = "", |
| 21 | + exported_headers = subdir_glob( |
| 22 | + [ |
| 23 | + ("", "*.h"), |
| 24 | + ], |
| 25 | + prefix = "fabric/scrollview", |
| 26 | + ), |
| 27 | + compiler_flags = [ |
| 28 | + "-fexceptions", |
| 29 | + "-frtti", |
| 30 | + "-std=c++14", |
| 31 | + "-Wall", |
| 32 | + ], |
| 33 | + fbobjc_compiler_flags = APPLE_COMPILER_FLAGS, |
| 34 | + fbobjc_preprocessor_flags = get_debug_preprocessor_flags() + get_apple_inspector_flags(), |
| 35 | + fbobjc_tests = [ |
| 36 | + ":tests", |
| 37 | + ], |
| 38 | + force_static = True, |
| 39 | + macosx_tests_override = [], |
| 40 | + platforms = (ANDROID, APPLE), |
| 41 | + preprocessor_flags = [ |
| 42 | + "-DLOG_TAG=\"ReactNative\"", |
| 43 | + "-DWITH_FBSYSTRACE=1", |
| 44 | + ], |
| 45 | + 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 | + "xplat//yoga:yoga", |
| 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/view:view"), |
| 58 | + ], |
| 59 | +) |
| 60 | + |
| 61 | +if not IS_OSS_BUILD: |
| 62 | + load("@xplat//build_defs:fb_xplat_cxx_test.bzl", "fb_xplat_cxx_test") |
| 63 | + |
| 64 | + fb_xplat_cxx_test( |
| 65 | + name = "tests", |
| 66 | + srcs = glob(["tests/**/*.cpp"]), |
| 67 | + headers = glob(["tests/**/*.h"]), |
| 68 | + contacts = ["oncall+react_native@xmail.facebook.com"], |
| 69 | + compiler_flags = [ |
| 70 | + "-fexceptions", |
| 71 | + "-frtti", |
| 72 | + "-std=c++14", |
| 73 | + "-Wall", |
| 74 | + ], |
| 75 | + platforms = APPLE, |
| 76 | + deps = [ |
| 77 | + "xplat//folly:molly", |
| 78 | + "xplat//third-party/gmock:gtest", |
| 79 | + ":scrollview", |
| 80 | + ], |
| 81 | + ) |
0 commit comments