From 9d08d55bbef4e79a8843deef90bef828f7b9a6ef Mon Sep 17 00:00:00 2001 From: Anandraj Govindan Date: Mon, 3 Oct 2022 05:09:20 -0700 Subject: [PATCH] Use NMake generator for Hermes build on Windows (#34790) 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: https://github.com/facebook/react-native/pull/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 --- ReactAndroid/hermes-engine/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReactAndroid/hermes-engine/build.gradle b/ReactAndroid/hermes-engine/build.gradle index 79a260b1fc578c..07ae7a3a85ae6e 100644 --- a/ReactAndroid/hermes-engine/build.gradle +++ b/ReactAndroid/hermes-engine/build.gradle @@ -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) {