SIGN IN SIGN UP
facebook / react-native UNCLAIMED

A framework for building native applications using React

0 0 96 C++

Guard cxxreact MethodCall tests under legacy-arch macro (#56902)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56902

`parseMethodCalls` (used by `packages/react-native/ReactCommon/cxxreact/tests/methodcall.cpp`) is only declared in `<cxxreact/MethodCall.h>` when legacy architecture support is compiled in. Wrap the test body in `#ifndef RCT_REMOVE_LEGACY_ARCH` so the translation unit compiles to a no-op when legacy arch is removed, instead of failing with `use of undeclared identifier 'parseMethodCalls'`.

Also configure the `tests` target so its Apple builds run under a target platform that carries the `react-fit-enabled` constraint. A new per-package `apple_target_platforms()` declares `tests-apple-platform`, and the `rn_xplat_cxx_test` rule wires it in via `fbobjc_ios_config_backed_target_platform` / `fbobjc_macosx_config_backed_target_platform`. Under that configuration `RCT_REMOVE_LEGACY_ARCH` is defined and the guarded test body is elided, matching the behavior of the rest of the post-legacy-arch test suite.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D105737807

fbshipit-source-id: f5fa7ff73a564356746890eb528e3a91f06113f4
C
Christoph Purrer committed
3cfe3e3d1bb4403168382a086fc42d78f524452c
Parent: a0d39e7
Committed by meta-codesync[bot] <215208954+meta-codesync[bot]@users.noreply.github.com> on 5/19/2026, 9:08:39 PM