diff --git a/packages/react-native/ReactAndroid/hermes-engine/build.gradle.kts b/packages/react-native/ReactAndroid/hermes-engine/build.gradle.kts index 2bef4ad45041..7db67e79333a 100644 --- a/packages/react-native/ReactAndroid/hermes-engine/build.gradle.kts +++ b/packages/react-native/ReactAndroid/hermes-engine/build.gradle.kts @@ -96,6 +96,7 @@ val ndkBuildJobs = Runtime.getRuntime().availableProcessors().toString() val prefabHeadersDir = File("$buildDir/prefab-headers") // We inject the JSI directory used inside the Hermes build with the -DJSI_DIR config. +// CMake reads the backslashes of a Windows path as escape sequences, so we pass forward slashes. val jsiDir = File(reactNativeRootDir, "ReactCommon/jsi") val downloadHermesDest = File(downloadsDir, "hermes.tar.gz") @@ -158,7 +159,7 @@ fun configureBuildForHermesCommandLineArgs( ".", "-B", hermesBuildDir.toString(), - "-DJSI_DIR=" + jsiDir.absolutePath, + "-DJSI_DIR=" + jsiDir.invariantSeparatorsPath, "-DCMAKE_BUILD_TYPE=Release", ) if (enableDebugger) { @@ -340,7 +341,7 @@ android { "-DANDROID_STL=c++_shared", "-DANDROID_PIE=True", "-DIMPORT_HOST_COMPILERS=${File(hermesBuildDir, "ImportHostCompilers.cmake").toString()}", - "-DJSI_DIR=${jsiDir}", + "-DJSI_DIR=${jsiDir.invariantSeparatorsPath}", "-DHERMES_BUILD_SHARED_JSI=True", "-DHERMES_RELEASE_VERSION=for RN ${version}", "-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=True",