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 -D options is not followed by a space, see #59. Example script\cmake_vs2022.bat build -DURHO3D_SAMPLES=1. This can easily be avoided by adding the needed space after -D. However when used with Emscripten's emcmake to setup for Web, the infinite loop will be encountered once more because emcmake emits the CMAKE_TOOLCHAIN_FILE and CMAKE_CROSSCOMPILING_EMULATOR build options with no space after -D.
Additionally, emcmake emits the MinGW makefiles generator flag without quotes around MinGW Makefiles and this breaks CMake.
In Source\Tools\CMakeLists.txt, the CMake command to install PackageTool and BindingGenerator under the CMAKE_CROSSCOMPILING option specifies these files without an extension. When building for Web on Windows, the builds are successful but installation fails with error file INSTALL cannot find <path/to/file> because the file being looked for has no extension while the actual file that was built has .exe extension.
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)
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
-D
options 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'semcmake
to setup for Web, the infinite loop will be encountered once more becauseemcmake
emits theCMAKE_TOOLCHAIN_FILE
andCMAKE_CROSSCOMPILING_EMULATOR
build options with no space after-D
.Additionally,
emcmake
emits the MinGW makefiles generator flag without quotes aroundMinGW Makefiles
and this breaks CMake.In Source\Tools\CMakeLists.txt, the CMake command to install
PackageTool
andBindingGenerator
under theCMAKE_CROSSCOMPILING
option 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.exe
extension.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)