Fix Issues Building For Web on Windows #65
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 Infinite Loop inscript/cmake_generic.bat
#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)