Hi,
I had successfuly compiled and ran my project with emscripten by linking with Urho from my own build system.
Now i am trying to use Urho’s build system following below documentation :
Got two issues with that :
== 1) My project must be compiled for windows, asmjs and android, so i am using cmake_vs2015.bat cmake_emscripten.bat and cmake_android.bat to compile respectively in folders build_vs2015/ build_asmjs/ and build_android/
The issue is that i have to define URHO3D_HOME with the correct build_xxx/ according to current platform.
I used to use if(EMSCRIPTEN) condition to detect if i am building for asmjs as it is a variable automaticaly setted by emscripten toolchain.
if(EMSCRIPTEN)
set(URHO3D_HOME "C:/Users/hcomere/Perso/Urho3D-1.6/build_asmjs")
elseif(ANDROID)
set(URHO3D_HOME "C:/Users/hcomere/Perso/Urho3D-1.6/build_android")
elseif(WIN32)
set(URHO3D_HOME "C:/Users/hcomere/Perso/Urho3D-1.6/build_vs2015")
endif()
But this does not work, EMSCRIPTEN variable seems to be undefined using Urho scripts.
I had to add the definitions in cmake_generic.bat
if "%~1" == "-DWEB" if "%~2" == "1" set "OPTS=-G "MinGW Makefiles" -DCMAKE_TOOLCHAIN_FILE="%TOOLCHAINS%\emscripten.toolchain.cmake" -DEMSCRIPTEN=1"
What is the usual way to define URHO3D_HOME according to the platform without customizing cmake_generic.bat ?
== 2)
The second issue is way more strange, the compilation is OK but i am simply not able to run my project due to a javascript error :
Uncaught TypeError: Cannot read property 'viewport' of undefined
It worked well with my build system and compiled Urho web samples work well …
It is like the webgl context has not be created but i do not have any error about that.
Any guess?
Regards,
Harold