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
-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)