1 | load("@fbsource//tools/build_defs/apple:flag_defs.bzl", "get_debug_preprocessor_flags")
|
2 | load(
|
3 | "//tools/build_defs/oss:rn_defs.bzl",
|
4 | "ANDROID",
|
5 | "APPLE",
|
6 | "fb_xplat_cxx_test",
|
7 | "get_apple_compiler_flags",
|
8 | "get_apple_inspector_flags",
|
9 | "react_native_xplat_target",
|
10 | "rn_xplat_cxx_library",
|
11 | "subdir_glob",
|
12 | )
|
13 |
|
14 | APPLE_COMPILER_FLAGS = get_apple_compiler_flags()
|
15 |
|
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 | fbandroid_exported_headers = subdir_glob(
|
32 | [
|
33 | ("", "*.h"),
|
34 | ],
|
35 | prefix = "react/imagemanager",
|
36 | ),
|
37 | fbandroid_headers = subdir_glob(
|
38 | [
|
39 | ("", "*.h"),
|
40 | ("platform/android", "**/*.h"),
|
41 | ],
|
42 | prefix = "",
|
43 | ),
|
44 | fbandroid_srcs = glob(
|
45 | [
|
46 | "platform/android/**/*.cpp",
|
47 | ],
|
48 | ),
|
49 | fbobjc_compiler_flags = APPLE_COMPILER_FLAGS,
|
50 | fbobjc_preprocessor_flags = get_debug_preprocessor_flags() + get_apple_inspector_flags(),
|
51 | force_static = True,
|
52 | ios_deps = [
|
53 | "xplat//js:RCTImage",
|
54 | "xplat//js/react-native-github:RCTCxxBridge",
|
55 | ],
|
56 | ios_exported_headers = subdir_glob(
|
57 | [
|
58 | ("", "*.h"),
|
59 | ("platform/ios", "RCTImagePrimitivesConversions.h"),
|
60 | ],
|
61 | prefix = "react/imagemanager",
|
62 | ),
|
63 | ios_frameworks = [
|
64 | "$SDKROOT/System/Library/Frameworks/CoreGraphics.framework",
|
65 | "$SDKROOT/System/Library/Frameworks/Foundation.framework",
|
66 | "$SDKROOT/System/Library/Frameworks/UIKit.framework",
|
67 | ],
|
68 | ios_headers = subdir_glob(
|
69 | [
|
70 | ("", "*.h"),
|
71 | ("platform/ios", "**/*.h"),
|
72 | ],
|
73 | prefix = "",
|
74 | ),
|
75 | ios_srcs = glob(
|
76 | [
|
77 | "platform/ios/**/*.cpp",
|
78 | "platform/ios/**/*.mm",
|
79 | ],
|
80 | ),
|
81 | macosx_tests_override = [],
|
82 | platforms = (ANDROID, APPLE),
|
83 | preprocessor_flags = [
|
84 | "-DLOG_TAG=\"ReactNative\"",
|
85 | "-DWITH_FBSYSTRACE=1",
|
86 | ],
|
87 | tests = [":tests"],
|
88 | visibility = ["PUBLIC"],
|
89 | deps = [
|
90 | "xplat//fbsystrace:fbsystrace",
|
91 | "xplat//folly:futures",
|
92 | "xplat//folly:headers_only",
|
93 | "xplat//folly:memory",
|
94 | "xplat//folly:molly",
|
95 | "xplat//third-party/glog:glog",
|
96 | "xplat//yoga:yoga",
|
97 | react_native_xplat_target("fabric/core:core"),
|
98 | react_native_xplat_target("fabric/mounting:mounting"),
|
99 | react_native_xplat_target("fabric/debug:debug"),
|
100 | react_native_xplat_target("fabric/graphics:graphics"),
|
101 | ],
|
102 | )
|
103 |
|
104 | fb_xplat_cxx_test(
|
105 | name = "tests",
|
106 | srcs = glob(["tests/**/*.cpp"]),
|
107 | headers = glob(["tests/**/*.h"]),
|
108 | compiler_flags = [
|
109 | "-fexceptions",
|
110 | "-frtti",
|
111 | "-std=c++14",
|
112 | "-Wall",
|
113 | ],
|
114 | contacts = ["oncall+react_native@xmail.facebook.com"],
|
115 | platforms = (ANDROID, APPLE),
|
116 | deps = [
|
117 | "xplat//folly:molly",
|
118 | "xplat//third-party/gmock:gtest",
|
119 | ":imagemanager",
|
120 | ],
|
121 | )
|