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