1load( 2 "//tools/build_defs/oss:rn_defs.bzl", 3 "ANDROID", 4 "APPLE", 5 "CXX", 6 "YOGA_CXX_TARGET", 7 "fb_xplat_cxx_test", 8 "get_apple_compiler_flags", 9 "get_apple_inspector_flags", 10 "get_preprocessor_flags_for_build_mode", 11 "react_native_xplat_target", 12 "rn_xplat_cxx_library", 13 "subdir_glob", 14) 15 16APPLE_COMPILER_FLAGS = get_apple_compiler_flags() 17 18rn_xplat_cxx_library( 19 name = "root", 20 srcs = glob( 21 ["**/*.cpp"], 22 exclude = glob(["tests/**/*.cpp"]), 23 ), 24 headers = [], 25 header_namespace = "", 26 exported_headers = subdir_glob( 27 [ 28 ("", "*.h"), 29 ], 30 prefix = "react/renderer/components/root", 31 ), 32 compiler_flags_pedantic = True, 33 fbobjc_compiler_flags = APPLE_COMPILER_FLAGS, 34 fbobjc_preprocessor_flags = get_preprocessor_flags_for_build_mode() + get_apple_inspector_flags(), 35 labels = [ 36 "pfh:ReactNative_CommonInfrastructurePlaceholder", 37 ], 38 macosx_tests_override = [], 39 platforms = (ANDROID, APPLE, CXX), 40 preprocessor_flags = [ 41 "-DLOG_TAG=\"ReactNative\"", 42 "-DWITH_FBSYSTRACE=1", 43 ], 44 tests = [":tests"], 45 visibility = ["PUBLIC"], 46 deps = [ 47 "//third-party/glog:glog", 48 "//xplat/fbsystrace:fbsystrace", 49 YOGA_CXX_TARGET, 50 react_native_xplat_target("react/renderer/debug:debug"), 51 react_native_xplat_target("react/renderer/core:core"), 52 react_native_xplat_target("react/renderer/graphics:graphics"), 53 react_native_xplat_target("react/renderer/components/view:view"), 54 ], 55) 56 57fb_xplat_cxx_test( 58 name = "tests", 59 srcs = glob(["tests/**/*.cpp"]), 60 headers = glob(["tests/**/*.h"]), 61 compiler_flags = [ 62 "-fexceptions", 63 "-frtti", 64 "-std=c++17", 65 "-Wall", 66 ], 67 contacts = ["[email protected]"], 68 platforms = (ANDROID, APPLE, CXX), 69 deps = [ 70 ":root", 71 "//xplat/third-party/gmock:gtest", 72 react_native_xplat_target("react/renderer/element:element"), 73 ], 74) 75