U3D
U3D copied to clipboard
Fix Issues Building For Web on Windows
Two issues are currently encountered when building Urho3D for Web on Windows.
-
While setting up a build by directly or indirectly calling script\cmake_generic.bat, an infinite loop will occur when the
-Doptions is not followed by a space, see #59. Examplescript\cmake_vs2022.bat build -DURHO3D_SAMPLES=1. This can easily be avoided by adding the needed space after-D. However when used with Emscripten'semcmaketo setup for Web, the infinite loop will be encountered once more becauseemcmakeemits theCMAKE_TOOLCHAIN_FILEandCMAKE_CROSSCOMPILING_EMULATORbuild options with no space after-D.Additionally,
emcmakeemits the MinGW makefiles generator flag without quotes aroundMinGW Makefilesand this breaks CMake. -
In Source\Tools\CMakeLists.txt, the CMake command to install
PackageToolandBindingGeneratorunder theCMAKE_CROSSCOMPILINGoption specifies these files without an extension. When building for Web on Windows, the builds are successful but installation fails with errorfile INSTALL cannot find <path/to/file>because the file being looked for has no extension while the actual file that was built has.exeextension.
This PR fixes the above mentioned issues and was tested on a Windows 11 machine using Emscripten version 3.1.59 ( the latest version at the time of this post)