Skip to content

Commit 2d61709

Browse files
j-piaseckireact-native-bot
authored andcommitted
Propagate Hermes V1 opt-in to Fantom (#55157)
Summary: Pull Request resolved: #55157 Changelog: [Internal] At the moment, Fantom doesn't propagate the Hermes V1 opt-in to the React Native build, which causes the code that should be gated by compile-time flags to be compiled. Since Hermes V1 differs in some cases, the headers there are missing. This diff adds the opt-in propagation, so the code can be correctly compiled out. Reviewed By: cortinico Differential Revision: D90674696 fbshipit-source-id: d2adb131af4588e745c023703a893d0ecaaaee01
1 parent e8c26d4 commit 2d61709

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

private/react-native-fantom/build.gradle.kts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*/
77

88
import com.android.build.gradle.internal.tasks.factory.dependsOn
9+
import com.facebook.react.internal.PrivateReactExtension
910
import com.facebook.react.tasks.internal.*
1011
import com.facebook.react.tasks.internal.utils.*
1112
import de.undercouch.gradle.tasks.download.Download
@@ -15,6 +16,9 @@ plugins {
1516
alias(libs.plugins.download)
1617
}
1718

19+
val hermesV1Enabled =
20+
rootProject.extensions.getByType(PrivateReactExtension::class.java).hermesV1Enabled.get()
21+
1822
// This is the version of CMake we're requesting to the Android SDK to use.
1923
// If missing it will be downloaded automatically. Only CMake versions shipped with the
2024
// Android SDK are supported (you can find them listed in the SDK Manager of Android Studio).
@@ -198,6 +202,11 @@ val configureFantomTester by
198202
"-DREACT_THIRD_PARTY_NDK_DIR=$reactAndroidBuildDir/third-party-ndk",
199203
"-DRN_ENABLE_DEBUG_STRING_CONVERTIBLE=ON",
200204
)
205+
206+
if (hermesV1Enabled) {
207+
cmdArgs.add("-DHERMES_V1_ENABLED=1")
208+
}
209+
201210
commandLine(cmdArgs)
202211
standardOutputFile.set(project.file("$buildDir/reports/configure-fantom_tester.log"))
203212
errorOutputFile.set(project.file("$buildDir/reports/configure-fantom_tester.error.log"))

0 commit comments

Comments
 (0)