Skip to content

Commit

Permalink
Use NMake generator for Hermes build on Windows (#34790)
Browse files Browse the repository at this point in the history
Summary:
CMake on Windows uses "Visual Studio **" generators are [multi-configuration](https://cgold.readthedocs.io/en/latest/glossary/multi-config.html),

which requires the hermes cli and hermes runtime build flavors to be compatible. Using the "MakeFile" generator will avoid the requirement and keeps the gradle script simpler. Please note that the "Makefile" generator is the default when only "Visual Studio Community edition" with default packages is available.

Use NMake generator for Hermes build on Windows

## Changelog
CMake on Windows uses "Visual Studio **" generators are [multi-configuration](https://cgold.readthedocs.io/en/latest/glossary/multi-config.html),

which requires the hermes cli and hermes runtime build flavors to be compatible. Using the "MakeFile" generator will avoid the requirement and keeps the gradle script simpler. Please note that the "Makefile" generator is the default when only "Visual Studio Community edition"  with default packages  is available.

[Android] [Fixed] - Use NMake generator for Hermes build on Windows

Pull Request resolved: #34790

Test Plan: Verified that RN build on Windows with multiple SKUs of Visual studio.d

Reviewed By: cortinico

Differential Revision: D39889332

Pulled By: cortinico

fbshipit-source-id: f2d39d981e7c58c8cb93a4322155c844cb6bded3
  • Loading branch information
mganandraj authored and kelset committed Oct 11, 2022
1 parent 0c2f55d commit ebf746b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ReactAndroid/hermes-engine/build.gradle
Expand Up @@ -86,7 +86,7 @@ task unzipHermes(dependsOn: downloadHermes, type: Copy) {

task configureBuildForHermes(type: Exec) {
workingDir(hermesDir)
commandLine(windowsAwareCommandLine(findCmakePath(cmakeVersion), "-S", ".", "-B", hermesBuildDir.toString(), "-DJSI_DIR=" + jsiDir.absolutePath))
commandLine(windowsAwareCommandLine(findCmakePath(cmakeVersion), Os.isFamily(Os.FAMILY_WINDOWS) ? "-GNMake Makefiles" : "", "-S", ".", "-B", hermesBuildDir.toString(), "-DJSI_DIR=" + jsiDir.absolutePath))
}

task buildHermes(dependsOn: configureBuildForHermes, type: Exec) {
Expand Down

0 comments on commit ebf746b

Please sign in to comment.