diff --git a/packages/react-native/ReactAndroid/build.gradle.kts b/packages/react-native/ReactAndroid/build.gradle.kts index 531637e937d..fe74e3a6200 100644 --- a/packages/react-native/ReactAndroid/build.gradle.kts +++ b/packages/react-native/ReactAndroid/build.gradle.kts @@ -45,7 +45,7 @@ extra["publishing_version"] = project.findProperty("VERSION_NAME")?.toString()!! // This is the version of CMake we're requesting to the Android SDK to use. // If missing it will be downloaded automatically. Only CMake versions shipped with the // Android SDK are supported (you can find them listed in the SDK Manager of Android Studio). -val cmakeVersion = System.getenv("CMAKE_VERSION") ?: "3.22.1" +val cmakeVersion = System.getenv("CMAKE_VERSION") ?: "3.30.5" extra["cmake_version"] = cmakeVersion diff --git a/packages/react-native/ReactAndroid/hermes-engine/build.gradle.kts b/packages/react-native/ReactAndroid/hermes-engine/build.gradle.kts index 9fa746dff89..377afdb2edd 100644 --- a/packages/react-native/ReactAndroid/hermes-engine/build.gradle.kts +++ b/packages/react-native/ReactAndroid/hermes-engine/build.gradle.kts @@ -136,19 +136,22 @@ val configureBuildForHermes by workingDir(hermesDir) inputs.dir(hermesDir) outputs.files(hermesBuildOutputFileTree) - commandLine( + var cmakeCommandLine = windowsAwareCommandLine( cmakeBinaryPath, // Suppress all warnings as this is the Hermes build and we can't fix them. "--log-level=ERROR", "-Wno-dev", - if (Os.isFamily(Os.FAMILY_WINDOWS)) "-GNMake Makefiles" else "", "-S", ".", "-B", hermesBuildDir.toString(), "-DJSI_DIR=" + jsiDir.absolutePath, - )) + ) + if (Os.isFamily(Os.FAMILY_WINDOWS)) { + cmakeCommandLine = cmakeCommandLine + "-GNMake Makefiles" + } + commandLine(cmakeCommandLine) standardOutputFile.set(project.file("$buildDir/configure-hermesc.log")) } @@ -236,9 +239,9 @@ android { "-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON", "-DIMPORT_HERMESC=${File(hermesBuildDir, "ImportHermesc.cmake").toString()}", "-DJSI_DIR=${jsiDir}", - "-DHERMES_SLOW_DEBUG=False", "-DHERMES_BUILD_SHARED_JSI=True", "-DHERMES_RELEASE_VERSION=for RN ${version}", + "-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=True", // We intentionally build Hermes with Intl support only. This is to simplify // the build setup and to avoid overcomplicating the build-type matrix. "-DHERMES_ENABLE_INTL=True")