From 04da4800da1247e0aa37f3fef3241ade0e1d1b75 Mon Sep 17 00:00:00 2001 From: Andrew Datsenko Date: Sun, 22 Jun 2025 23:48:38 -0700 Subject: [PATCH] Gate RN_SERIALIZABLE_STATE behind ANDROID flag (#52155) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52155 Changelog: [Internal] Gating RN_SERIALIZABLE_STATE behind ANDROID flag so we can build ReactCommon with cmake when targeting different platforms. This will help build reac-native-fantom for OSS. Reviewed By: christophpurrer Differential Revision: D77034689 fbshipit-source-id: 15f9192c90693f4743f31fcf72f593802b622c47 --- .../ReactCommon/cmake-utils/react-native-flags.cmake | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/react-native/ReactCommon/cmake-utils/react-native-flags.cmake b/packages/react-native/ReactCommon/cmake-utils/react-native-flags.cmake index ae97237881c..d005a4e0b0d 100644 --- a/packages/react-native/ReactCommon/cmake-utils/react-native-flags.cmake +++ b/packages/react-native/ReactCommon/cmake-utils/react-native-flags.cmake @@ -28,6 +28,8 @@ SET(reactnative_FLAGS function(target_compile_reactnative_options target_name scope) target_compile_options(${target_name} ${scope} ${reactnative_FLAGS}) - target_compile_definitions(${target_name} ${scope} RN_SERIALIZABLE_STATE) + # TODO T228344694 improve this so that it works for all platforms + if(ANDROID) + target_compile_definitions(${target_name} ${scope} RN_SERIALIZABLE_STATE) + endif() endfunction() -