Skip to content

Commit 7b35df1

Browse files
cortinicouffoltzl
authored and
uffoltzl
committed
Bump CMake to 3.30.x and Enable INTERPROCEDURAL_OPTIMIZATION for libhermes.so in OSS
Summary: PR is here facebook#50581 This enables INTERPROCEDURAL_OPTIMIZATION for Hermes in OSS, similar to how we did for libreactnative.so I also had to bump CMake to 3.30.x to unblock the build failure with `-fuse-ld=gold` Changelog: [Internal] [Changed] - Reviewed By: alanleedev Differential Revision: D72696879 fbshipit-source-id: e842f6cdf41f6936ef4baeb70e4833a1a0c2d19b
1 parent 50e5390 commit 7b35df1

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

packages/react-native/ReactAndroid/build.gradle.kts

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ extra["publishing_version"] = project.findProperty("VERSION_NAME")?.toString()!!
4545
// This is the version of CMake we're requesting to the Android SDK to use.
4646
// If missing it will be downloaded automatically. Only CMake versions shipped with the
4747
// Android SDK are supported (you can find them listed in the SDK Manager of Android Studio).
48-
val cmakeVersion = System.getenv("CMAKE_VERSION") ?: "3.22.1"
48+
val cmakeVersion = System.getenv("CMAKE_VERSION") ?: "3.30.5"
4949

5050
extra["cmake_version"] = cmakeVersion
5151

packages/react-native/ReactAndroid/hermes-engine/build.gradle.kts

+7-4
Original file line numberDiff line numberDiff line change
@@ -136,19 +136,22 @@ val configureBuildForHermes by
136136
workingDir(hermesDir)
137137
inputs.dir(hermesDir)
138138
outputs.files(hermesBuildOutputFileTree)
139-
commandLine(
139+
var cmakeCommandLine =
140140
windowsAwareCommandLine(
141141
cmakeBinaryPath,
142142
// Suppress all warnings as this is the Hermes build and we can't fix them.
143143
"--log-level=ERROR",
144144
"-Wno-dev",
145-
if (Os.isFamily(Os.FAMILY_WINDOWS)) "-GNMake Makefiles" else "",
146145
"-S",
147146
".",
148147
"-B",
149148
hermesBuildDir.toString(),
150149
"-DJSI_DIR=" + jsiDir.absolutePath,
151-
))
150+
)
151+
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
152+
cmakeCommandLine = cmakeCommandLine + "-GNMake Makefiles"
153+
}
154+
commandLine(cmakeCommandLine)
152155
standardOutputFile.set(project.file("$buildDir/configure-hermesc.log"))
153156
}
154157

@@ -236,9 +239,9 @@ android {
236239
"-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON",
237240
"-DIMPORT_HERMESC=${File(hermesBuildDir, "ImportHermesc.cmake").toString()}",
238241
"-DJSI_DIR=${jsiDir}",
239-
"-DHERMES_SLOW_DEBUG=False",
240242
"-DHERMES_BUILD_SHARED_JSI=True",
241243
"-DHERMES_RELEASE_VERSION=for RN ${version}",
244+
"-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=True",
242245
// We intentionally build Hermes with Intl support only. This is to simplify
243246
// the build setup and to avoid overcomplicating the build-type matrix.
244247
"-DHERMES_ENABLE_INTL=True")

0 commit comments

Comments
 (0)