Browse Source

For Travis CI & AppVeyor - unified 'ci' rake task and spring cleaning.

Yao Wei Tjong 姚伟忠 10 years ago
parent
commit
431559c2bd

+ 11 - 11
.appveyor.yml

@@ -30,8 +30,11 @@ environment:
     secure: JgsjFoVAP5yjNxyS/+S+4byhtnTKCWfI3bkCmHws3P1MwSaUS5+0C6WV1pHIJTVW00Qvo3+JsgVqMYUJ7fo2m/bXvUPNCoSa4BifXZlS6bE=
     secure: JgsjFoVAP5yjNxyS/+S+4byhtnTKCWfI3bkCmHws3P1MwSaUS5+0C6WV1pHIJTVW00Qvo3+JsgVqMYUJ7fo2m/bXvUPNCoSa4BifXZlS6bE=
   SF_API:
   SF_API:
     secure: cc1q9CXo5BwIYqtgigHpkCGG90zEVM45xx/YzXTOjVp512oQNUzTJq0AmxEYXP78
     secure: cc1q9CXo5BwIYqtgigHpkCGG90zEVM45xx/YzXTOjVp512oQNUzTJq0AmxEYXP78
-  build_tree: native-Build
+# Using neither-in-nor-out-of-source (Urho3D-legacy) build tree when on AppVeyor; using out-of-source (and in-the-source) build tree when on Travis-CI for test coverage
+  build_tree: Build
   config: Release
   config: Release
+# We cannot afford to have a large matrix on AppVeyor at the moment
+  URHO3D_D3D11: 1
   matrix:
   matrix:
     - URHO3D_LIB_TYPE: STATIC
     - URHO3D_LIB_TYPE: STATIC
     - URHO3D_LIB_TYPE: SHARED
     - URHO3D_LIB_TYPE: SHARED
@@ -39,24 +42,21 @@ environment:
 #init:
 #init:
 # - ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
 # - ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
 install:
 install:
-  - ps: if ($env:APPVEYOR_REPO_TAG -eq "true" -or (!$env:APPVEYOR_PULL_REQUEST_NUMBER -and (select-string '\[ci package\]' -inputobject $env:APPVEYOR_REPO_COMMIT_MESSAGE_EXTENDED)))
+  - ps: if ($env:APPVEYOR_REPO_TAG -eq "true") { $env:RELEASE_TAG = $env:APPVEYOR_REPO_TAG_NAME };
+        if ($env:RELEASE_TAG -or ($env:APPVEYOR_REPO_BRANCH -eq "master" -and (!$env:APPVEYOR_PULL_REQUEST_NUMBER -and (select-string '\[ci package\]' -inputobject $env:APPVEYOR_REPO_COMMIT_MESSAGE_EXTENDED))))
         {
         {
-          if ($env:APPVEYOR_REPO_TAG -eq "true") { $env:RELEASE_TAG = $env:APPVEYOR_REPO_TAG_NAME } else { "Unshallowing git repository..."; git fetch -q --unshallow };
-          if ($env:URHO3D_LIB_TYPE -eq "STATIC" -and ($env:Platform -eq "x64")) { $env:SF_DEFAULT = "windows:Windows-64bit-STATIC-3D11.zip" };
           $env:PACKAGE_UPLOAD = "1";
           $env:PACKAGE_UPLOAD = "1";
+          if ($env:URHO3D_LIB_TYPE -eq "STATIC" -and ($env:Platform -eq "x64")) { $env:SF_DEFAULT = "windows:Windows-64bit-STATIC-3D11.zip" };
           do { "Installing doxygen and graphviz..."; choco install doxygen.portable graphviz.portable >$null } until ($?);
           do { "Installing doxygen and graphviz..."; choco install doxygen.portable graphviz.portable >$null } until ($?);
         }
         }
 build_script:
 build_script:
-  - if "%PLATFORM%" == "x64" set "OPTS=URHO3D_64BIT=1"
+  - if "%PLATFORM%" == "x64" set "URHO3D_64BIT=1"
 # Our free AppVeyor account is slow for normal daily CI, speed up the build a little bit by excluding Assimp and other tools in the normal build and use the Debug build configuration instead
 # Our free AppVeyor account is slow for normal daily CI, speed up the build a little bit by excluding Assimp and other tools in the normal build and use the Debug build configuration instead
-  - if "%PACKAGE_UPLOAD%" == "" set "OPTS=%OPTS% URHO3D_TOOLS=0" && set "config=Debug"
-  - rake cmake vs2015 %OPTS% URHO3D_LIB_TYPE=%URHO3D_LIB_TYPE% URHO3D_D3D11=1 URHO3D_LUAJIT=1 URHO3D_LUAJIT_AMALG=1 URHO3D_EXTRAS=1 URHO3D_TESTING=1 && rake make
-# Could not run test target yet as AppVeyor does not currently allow its service to interact with desktop
-# - rake make target=RUN_TESTS
-  - if "%PACKAGE_UPLOAD%" == "1" (echo "Packaging the build artifact..." && rake ci_appveyor_package_upload) else (echo Configuring downstream project using Urho3D library in its build tree... && rake scaffolding dir=UsingBuildTree >nul && cd UsingBuildTree && rake cmake vs2015 %OPTS% URHO3D_HOME=..\..\native-Build && rake make && echo Installing Urho3D SDK to default system-wide location... && cd .. && rake make target=install >nul && echo Configuring downstream project using Urho3D SDK... && rake scaffolding dir=UsingSDK >null && cd UsingSDK && rake cmake vs2015 %OPTS% && rake make)
+  - if "%PACKAGE_UPLOAD%" == "" set "URHO3D_TOOLS=0" && set "config=Debug"
+  - rake ci && if "%PACKAGE_UPLOAD%" == "1" rake ci_package_upload
 test: off
 test: off
 artifacts:
 artifacts:
-  - path: native-Build\*.zip
+  - path: Build\*.zip
 deploy: off
 deploy: off
 
 
 # vi: set ts=2 sw=2 expandtab:
 # vi: set ts=2 sw=2 expandtab:

+ 41 - 41
.travis.yml

@@ -30,7 +30,7 @@ env:
   global:
   global:
     - secure: DE9IUM+pIV757GU0ccfDJhA752442pKu3DyBthrzHW9+GbsqbfuJOx045CYNN5vOWutFPC0A51B9WxhLNpXXqD3mfU8MhP1gkF7SskrHvcAPrCyfdqZf1Q8XDP5phm2KbHhhwxQMYmmicd6yj8DPNy2wRoSgPSDp/ZUDk51XZDU=
     - secure: DE9IUM+pIV757GU0ccfDJhA752442pKu3DyBthrzHW9+GbsqbfuJOx045CYNN5vOWutFPC0A51B9WxhLNpXXqD3mfU8MhP1gkF7SskrHvcAPrCyfdqZf1Q8XDP5phm2KbHhhwxQMYmmicd6yj8DPNy2wRoSgPSDp/ZUDk51XZDU=
     - secure: ecj/PwpbHkH9AYFsc2TMeRuNm5E3xMM8A0x4AcGhzpwDuZWdFx3R1T4G9u45Z5aUyTJWGqOeX1JPaEVVFZuYnNBKRy0kmiUrM9EE0j7WsT57K48tP1ysn2ynyvHgbYkKOfYR0t8XAMWTBbulT9DVVk3DS69//2WgiXGDVUEJTyI=
     - secure: ecj/PwpbHkH9AYFsc2TMeRuNm5E3xMM8A0x4AcGhzpwDuZWdFx3R1T4G9u45Z5aUyTJWGqOeX1JPaEVVFZuYnNBKRy0kmiUrM9EE0j7WsT57K48tP1ysn2ynyvHgbYkKOfYR0t8XAMWTBbulT9DVVk3DS69//2WgiXGDVUEJTyI=
-    - NUMJOBS=4
+    - numjobs=4
     - USE_CCACHE=1
     - USE_CCACHE=1
     - CCACHE_SLOPPINESS=pch_defines,time_macros
     - CCACHE_SLOPPINESS=pch_defines,time_macros
     - CCACHE_COMPRESS=1
     - CCACHE_COMPRESS=1
@@ -67,48 +67,48 @@ matrix:
     - &MinGW-64bit
     - &MinGW-64bit
       compiler: x86_64-w64-mingw32-gcc-static
       compiler: x86_64-w64-mingw32-gcc-static
       addons: {apt: {sources: *default_sources, packages: [*default_packages, gcc-mingw-w64-x86-64, g++-mingw-w64-x86-64, binutils-mingw-w64-x86-64]}}
       addons: {apt: {sources: *default_sources, packages: [*default_packages, gcc-mingw-w64-x86-64, g++-mingw-w64-x86-64, binutils-mingw-w64-x86-64]}}
-      env: WINDOWS=1 URHO3D_LIB_TYPE=STATIC
+      env: WIN32=1 URHO3D_LIB_TYPE=STATIC
     - <<: *MinGW-64bit
     - <<: *MinGW-64bit
       compiler: x86_64-w64-mingw32-gcc-shared
       compiler: x86_64-w64-mingw32-gcc-shared
-      env: WINDOWS=1 URHO3D_LIB_TYPE=SHARED
+      env: WIN32=1 URHO3D_LIB_TYPE=SHARED
     - <<: *MinGW-64bit
     - <<: *MinGW-64bit
       compiler: x86_64-w64-mingw32-gcc-d3d9-static
       compiler: x86_64-w64-mingw32-gcc-d3d9-static
-      env: WINDOWS=1 URHO3D_LIB_TYPE=STATIC URHO3D_OPENGL=0
+      env: WIN32=1 URHO3D_LIB_TYPE=STATIC URHO3D_OPENGL=0
     - <<: *MinGW-64bit
     - <<: *MinGW-64bit
       compiler: x86_64-w64-mingw32-gcc-d3d9-shared
       compiler: x86_64-w64-mingw32-gcc-d3d9-shared
-      env: WINDOWS=1 URHO3D_LIB_TYPE=SHARED URHO3D_OPENGL=0
-    # Ubuntu 12.04 LTS does not have up-to-date D3D11 headers, disable the CI build jobs for D3D11 for now until Travis-CI upgrades their OS to 14.04 LTS or better
+      env: WIN32=1 URHO3D_LIB_TYPE=SHARED URHO3D_OPENGL=0
+    # Ubuntu 12.04 LTS does not have up-to-date D3D11 headers, disable the CI build jobs for D3D11 for now until Travis-CI upgrades their OS to 14.04 LTS or better (We may not need these anymore because now we already have CI jobs on AppVeyor to cover the D3D11 build)
     # <<: *MinGW-64bit
     # <<: *MinGW-64bit
     # compiler: x86_64-w64-mingw32-gcc-d3d11-static
     # compiler: x86_64-w64-mingw32-gcc-d3d11-static
-    # env: WINDOWS=1 URHO3D_LIB_TYPE=STATIC URHO3D_D3D11=1
+    # env: WIN32=1 URHO3D_LIB_TYPE=STATIC URHO3D_D3D11=1
     # <<: *MinGW-64bit
     # <<: *MinGW-64bit
     # compiler: x86_64-w64-mingw32-gcc-d3d11-shared
     # compiler: x86_64-w64-mingw32-gcc-d3d11-shared
-    # env: WINDOWS=1 URHO3D_LIB_TYPE=SHARED URHO3D_D3D11=1
+    # env: WIN32=1 URHO3D_LIB_TYPE=SHARED URHO3D_D3D11=1
     - &MinGW-32bit
     - &MinGW-32bit
       compiler: i686-w64-mingw32-gcc-static
       compiler: i686-w64-mingw32-gcc-static
       addons: {apt: {sources: *default_sources, packages: [*default_packages, gcc-mingw-w64-i686, g++-mingw-w64-i686, binutils-mingw-w64-i686]}}
       addons: {apt: {sources: *default_sources, packages: [*default_packages, gcc-mingw-w64-i686, g++-mingw-w64-i686, binutils-mingw-w64-i686]}}
-      env: WINDOWS=1 URHO3D_LIB_TYPE=STATIC URHO3D_64BIT=0
+      env: WIN32=1 URHO3D_LIB_TYPE=STATIC URHO3D_64BIT=0
     - <<: *MinGW-32bit
     - <<: *MinGW-32bit
       compiler: i686-w64-mingw32-gcc-shared
       compiler: i686-w64-mingw32-gcc-shared
-      env: WINDOWS=1 URHO3D_LIB_TYPE=SHARED URHO3D_64BIT=0
+      env: WIN32=1 URHO3D_LIB_TYPE=SHARED URHO3D_64BIT=0
     - <<: *MinGW-32bit
     - <<: *MinGW-32bit
       compiler: i686-w64-mingw32-gcc-d3d9-static
       compiler: i686-w64-mingw32-gcc-d3d9-static
-      env: WINDOWS=1 URHO3D_LIB_TYPE=STATIC URHO3D_64BIT=0 URHO3D_OPENGL=0
+      env: WIN32=1 URHO3D_LIB_TYPE=STATIC URHO3D_64BIT=0 URHO3D_OPENGL=0
     - <<: *MinGW-32bit
     - <<: *MinGW-32bit
       compiler: i686-w64-mingw32-gcc-d3d9-shared
       compiler: i686-w64-mingw32-gcc-d3d9-shared
-      env: WINDOWS=1 URHO3D_LIB_TYPE=SHARED URHO3D_64BIT=0 URHO3D_OPENGL=0
+      env: WIN32=1 URHO3D_LIB_TYPE=SHARED URHO3D_64BIT=0 URHO3D_OPENGL=0
     # <<: *MinGW-32bit
     # <<: *MinGW-32bit
     # compiler: i686-w64-mingw32-gcc-d3d11-static
     # compiler: i686-w64-mingw32-gcc-d3d11-static
-    # env: WINDOWS=1 URHO3D_LIB_TYPE=STATIC URHO3D_64BIT=0 URHO3D_D3D11=1
+    # env: WIN32=1 URHO3D_LIB_TYPE=STATIC URHO3D_64BIT=0 URHO3D_D3D11=1
     # <<: *MinGW-32bit
     # <<: *MinGW-32bit
     # compiler: i686-w64-mingw32-gcc-d3d11-shared
     # compiler: i686-w64-mingw32-gcc-d3d11-shared
-    # env: WINDOWS=1 URHO3D_LIB_TYPE=SHARED URHO3D_64BIT=0 URHO3D_D3D11=1
+    # env: WIN32=1 URHO3D_LIB_TYPE=SHARED URHO3D_64BIT=0 URHO3D_D3D11=1
 before_script:
 before_script:
   - export TAG=$(git describe --exact-match $TRAVIS_COMMIT 2>/dev/null); if [[ $TAG =~ [[:digit:]]+\.[[:digit:]]+ ]]; then export RELEASE_TAG=$TAG; fi
   - export TAG=$(git describe --exact-match $TRAVIS_COMMIT 2>/dev/null); if [[ $TAG =~ [[:digit:]]+\.[[:digit:]]+ ]]; then export RELEASE_TAG=$TAG; fi
   - export COMMIT_MESSAGE=$(git log --format=%B -n 1 $TRAVIS_COMMIT)
   - export COMMIT_MESSAGE=$(git log --format=%B -n 1 $TRAVIS_COMMIT)
   - if [ $RELEASE_TAG ] || ([ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]); then if [ ${TRAVIS_JOB_NUMBER##*.} == 1 ]; then export SITE_UPDATE=1; fi; if [ "$CC" == "gcc" ] && ([ $RELEASE_TAG ] || echo $COMMIT_MESSAGE |grep -cq '\[ci package\]'); then export PACKAGE_UPLOAD=1; fi; fi
   - if [ $RELEASE_TAG ] || ([ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]); then if [ ${TRAVIS_JOB_NUMBER##*.} == 1 ]; then export SITE_UPDATE=1; fi; if [ "$CC" == "gcc" ] && ([ $RELEASE_TAG ] || echo $COMMIT_MESSAGE |grep -cq '\[ci package\]'); then export PACKAGE_UPLOAD=1; fi; fi
   - if [ $LINUX ]; then if [ "$URHO3D_64BIT" == "0" ]; then export CMAKE_PREFIX_PATH=/usr/lib/i386-linux-gnu; else export DISPLAY=:99.0; bash -e /etc/init.d/xvfb start; fi; fi
   - if [ $LINUX ]; then if [ "$URHO3D_64BIT" == "0" ]; then export CMAKE_PREFIX_PATH=/usr/lib/i386-linux-gnu; else export DISPLAY=:99.0; bash -e /etc/init.d/xvfb start; fi; fi
-  - if [ $WINDOWS ]; then if [ "$URHO3D_64BIT" == "0" ]; then export ARCH=i686; else export ARCH=x86_64; fi && export MINGW_PREFIX=/usr/bin/${ARCH}-w64-mingw32; fi
+  - if [ $WIN32 ]; then if [ "$URHO3D_64BIT" == "0" ]; then export ARCH=i686; else export ARCH=x86_64; fi && export MINGW_PREFIX=/usr/bin/${ARCH}-w64-mingw32; fi
   # MinGW package on Ubuntu 12.04 LTS does not come with d3dcompiler.h file which is required by our CI build with URHO3D_OPENGL=0.
   # MinGW package on Ubuntu 12.04 LTS does not come with d3dcompiler.h file which is required by our CI build with URHO3D_OPENGL=0.
   # Temporarily workaround the problem by downloading the missing header from Ubuntu 14.04 LTS source package.
   # Temporarily workaround the problem by downloading the missing header from Ubuntu 14.04 LTS source package.
   - if [ $URHO3D_OPENGL ]; then mkdir -p ../Build/{,generated/{UsingBuildTree,UsingSDK}/}include/Urho3D/ThirdParty && wget -P ../Build/include/Urho3D/ThirdParty http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/trusty/mingw-w64/trusty/download/package-import%40ubuntu.com-20130624192537-vzn12bb7qd5w3iy8/d3dcompiler.h-20120402093420-bk10a737hzitlkgj-65/d3dcompiler.h && for d in UsingBuildTree UsingSDK; do bash -c "cd ../Build/generated/$d/include/Urho3D/ThirdParty && ln -s ../../../../../include/Urho3D/ThirdParty/d3dcompiler.h ."; done; fi
   - if [ $URHO3D_OPENGL ]; then mkdir -p ../Build/{,generated/{UsingBuildTree,UsingSDK}/}include/Urho3D/ThirdParty && wget -P ../Build/include/Urho3D/ThirdParty http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/trusty/mingw-w64/trusty/download/package-import%40ubuntu.com-20130624192537-vzn12bb7qd5w3iy8/d3dcompiler.h-20120402093420-bk10a737hzitlkgj-65/d3dcompiler.h && for d in UsingBuildTree UsingSDK; do bash -c "cd ../Build/generated/$d/include/Urho3D/ThirdParty && ln -s ../../../../../include/Urho3D/ThirdParty/d3dcompiler.h ."; done; fi
@@ -169,7 +169,7 @@ addons: {apt: {sources: [kubuntu-backports, ubuntu-toolchain-r-test], packages:
 env:
 env:
   global:
   global:
     - secure: DE9IUM+pIV757GU0ccfDJhA752442pKu3DyBthrzHW9+GbsqbfuJOx045CYNN5vOWutFPC0A51B9WxhLNpXXqD3mfU8MhP1gkF7SskrHvcAPrCyfdqZf1Q8XDP5phm2KbHhhwxQMYmmicd6yj8DPNy2wRoSgPSDp/ZUDk51XZDU=
     - secure: DE9IUM+pIV757GU0ccfDJhA752442pKu3DyBthrzHW9+GbsqbfuJOx045CYNN5vOWutFPC0A51B9WxhLNpXXqD3mfU8MhP1gkF7SskrHvcAPrCyfdqZf1Q8XDP5phm2KbHhhwxQMYmmicd6yj8DPNy2wRoSgPSDp/ZUDk51XZDU=
-    - NUMJOBS=4
+    - numjobs=4
     - USE_CCACHE=1
     - USE_CCACHE=1
     - CCACHE_SLOPPINESS=pch_defines,time_macros
     - CCACHE_SLOPPINESS=pch_defines,time_macros
     - CCACHE_COMPRESS=1
     - CCACHE_COMPRESS=1
@@ -197,7 +197,7 @@ env:
   global:
   global:
     - secure: DE9IUM+pIV757GU0ccfDJhA752442pKu3DyBthrzHW9+GbsqbfuJOx045CYNN5vOWutFPC0A51B9WxhLNpXXqD3mfU8MhP1gkF7SskrHvcAPrCyfdqZf1Q8XDP5phm2KbHhhwxQMYmmicd6yj8DPNy2wRoSgPSDp/ZUDk51XZDU=
     - secure: DE9IUM+pIV757GU0ccfDJhA752442pKu3DyBthrzHW9+GbsqbfuJOx045CYNN5vOWutFPC0A51B9WxhLNpXXqD3mfU8MhP1gkF7SskrHvcAPrCyfdqZf1Q8XDP5phm2KbHhhwxQMYmmicd6yj8DPNy2wRoSgPSDp/ZUDk51XZDU=
     - secure: ecj/PwpbHkH9AYFsc2TMeRuNm5E3xMM8A0x4AcGhzpwDuZWdFx3R1T4G9u45Z5aUyTJWGqOeX1JPaEVVFZuYnNBKRy0kmiUrM9EE0j7WsT57K48tP1ysn2ynyvHgbYkKOfYR0t8XAMWTBbulT9DVVk3DS69//2WgiXGDVUEJTyI=
     - secure: ecj/PwpbHkH9AYFsc2TMeRuNm5E3xMM8A0x4AcGhzpwDuZWdFx3R1T4G9u45Z5aUyTJWGqOeX1JPaEVVFZuYnNBKRy0kmiUrM9EE0j7WsT57K48tP1ysn2ynyvHgbYkKOfYR0t8XAMWTBbulT9DVVk3DS69//2WgiXGDVUEJTyI=
-    - NUMJOBS=4
+    - numjobs=4
     - ANDROID=1
     - ANDROID=1
     - ANDROID_TMP=~/tmp
     - ANDROID_TMP=~/tmp
     - PACKAGE_JOB_END=9
     - PACKAGE_JOB_END=9
@@ -208,8 +208,8 @@ matrix:
   fast_finish: true
   fast_finish: true
   include:
   include:
     # x86 and x86_64 emulation currently requires hardware acceleration which Travis-CI cannot provide, so skip AVD for now
     # x86 and x86_64 emulation currently requires hardware acceleration which Travis-CI cannot provide, so skip AVD for now
-    # env: API=21 ABI=x86_64      URHO3D_LIB_TYPE=SHARED INSTALL=sys-img-x86_64-android-21 AVD=test_21_x86_64 USE_CCACHE=2
-    # env: API=21 ABI=x86         URHO3D_LIB_TYPE=SHARED INSTALL=sys-img-x86-android-21 AVD=test_21_x86       USE_CCACHE=2
+    # env: ANDROID_NATIVE_API_LEVEL=21 ANDROID_ABI=x86_64      URHO3D_LIB_TYPE=SHARED INSTALL=sys-img-x86_64-android-21 AVD=test_21_x86_64 USE_CCACHE=2
+    # env: ANDROID_NATIVE_API_LEVEL=21 ANDROID_ABI=x86         URHO3D_LIB_TYPE=SHARED INSTALL=sys-img-x86-android-21 AVD=test_21_x86       USE_CCACHE=2
 
 
     # Travis CI does not create one cache per job at the moment, so workaround it to have still high cache hit/miss ratio
     # Travis CI does not create one cache per job at the moment, so workaround it to have still high cache hit/miss ratio
     # We use jdk key as the cache storage differentiator! Our library is compiled using NDK so it should not be affected by JDK version
     # We use jdk key as the cache storage differentiator! Our library is compiled using NDK so it should not be affected by JDK version
@@ -218,40 +218,40 @@ matrix:
     # The other 5 jobs are cached using our own cache store (originally designed for Travis CI legacy build infra)
     # The other 5 jobs are cached using our own cache store (originally designed for Travis CI legacy build infra)
     - &cache1
     - &cache1
       jdk: oraclejdk8
       jdk: oraclejdk8
-      env: API=21 ABI=x86_64      URHO3D_LIB_TYPE=STATIC INSTALL=sys-img-x86_64-android-21     USE_CCACHE=1
+      env: ANDROID_NATIVE_API_LEVEL=21 ANDROID_ABI=x86_64      URHO3D_LIB_TYPE=STATIC INSTALL=sys-img-x86_64-android-21     USE_CCACHE=1
     - &alternative-cache
     - &alternative-cache
       cache: false
       cache: false
-      env: API=21 ABI=x86_64      URHO3D_LIB_TYPE=SHARED INSTALL=sys-img-x86_64-android-21     USE_CCACHE=2
+      env: ANDROID_NATIVE_API_LEVEL=21 ANDROID_ABI=x86_64      URHO3D_LIB_TYPE=SHARED INSTALL=sys-img-x86_64-android-21     USE_CCACHE=2
     - &cache2
     - &cache2
       jdk: openjdk7
       jdk: openjdk7
-      env: API=21 ABI=x86         URHO3D_LIB_TYPE=STATIC INSTALL=sys-img-x86-android-21        USE_CCACHE=1
+      env: ANDROID_NATIVE_API_LEVEL=21 ANDROID_ABI=x86         URHO3D_LIB_TYPE=STATIC INSTALL=sys-img-x86-android-21        USE_CCACHE=1
     - <<: *alternative-cache
     - <<: *alternative-cache
-      env: API=21 ABI=x86         URHO3D_LIB_TYPE=SHARED INSTALL=sys-img-x86-android-21        USE_CCACHE=2
+      env: ANDROID_NATIVE_API_LEVEL=21 ANDROID_ABI=x86         URHO3D_LIB_TYPE=SHARED INSTALL=sys-img-x86-android-21        USE_CCACHE=2
     - &cache3
     - &cache3
       jdk: openjdk6
       jdk: openjdk6
-      # ANDROID_ABI=arm64-v8a uses NEON by default, so the following two CI jobs also test NEON code path in the build
-      env: API=21 ABI=arm64-v8a   URHO3D_LIB_TYPE=STATIC NO_SDK_SYSIMG=1                       USE_CCACHE=1
+      # ANDROID_ANDROID_ABI=arm64-v8a uses NEON by default, so the following two CI jobs also test NEON code path in the build
+      env: ANDROID_NATIVE_API_LEVEL=21 ANDROID_ABI=arm64-v8a   URHO3D_LIB_TYPE=STATIC NO_SDK_SYSIMG=1                       USE_CCACHE=1
     - <<: *alternative-cache
     - <<: *alternative-cache
-      env: API=21 ABI=arm64-v8a   URHO3D_LIB_TYPE=SHARED NO_SDK_SYSIMG=1                       USE_CCACHE=2
+      env: ANDROID_NATIVE_API_LEVEL=21 ANDROID_ABI=arm64-v8a   URHO3D_LIB_TYPE=SHARED NO_SDK_SYSIMG=1                       USE_CCACHE=2
     - <<: *alternative-cache
     - <<: *alternative-cache
-      env: API=21 ABI=armeabi-v7a URHO3D_LIB_TYPE=STATIC                                       USE_CCACHE=2
+      env: ANDROID_NATIVE_API_LEVEL=21 ANDROID_ABI=armeabi-v7a URHO3D_LIB_TYPE=STATIC                                       USE_CCACHE=2
     - &cache4
     - &cache4
       jdk: oraclejdk7
       jdk: oraclejdk7
-      env: API=21 ABI=armeabi-v7a URHO3D_LIB_TYPE=SHARED AVD=test_21_armeabi-v7a               USE_CCACHE=1
+      env: ANDROID_NATIVE_API_LEVEL=21 ANDROID_ABI=armeabi-v7a URHO3D_LIB_TYPE=SHARED AVD=test_21_armeabi-v7a               USE_CCACHE=1
     - <<: *alternative-cache
     - <<: *alternative-cache
-      env: API=19 ABI=armeabi-v7a URHO3D_LIB_TYPE=STATIC                                       USE_CCACHE=2
+      env: ANDROID_NATIVE_API_LEVEL=19 ANDROID_ABI=armeabi-v7a URHO3D_LIB_TYPE=STATIC                                       USE_CCACHE=2
     - &cache5
     - &cache5
-      env: API=19 ABI=armeabi-v7a URHO3D_LIB_TYPE=SHARED AVD=test_19_armeabi-v7a               USE_CCACHE=1
+      env: ANDROID_NATIVE_API_LEVEL=19 ANDROID_ABI=armeabi-v7a URHO3D_LIB_TYPE=SHARED AVD=test_19_armeabi-v7a               USE_CCACHE=1
 before_script:
 before_script:
   - export TRAVIS_COMMIT=$TRAVIS_COMMIT~
   - export TRAVIS_COMMIT=$TRAVIS_COMMIT~
   - export TAG=$(git describe --exact-match $TRAVIS_COMMIT 2>/dev/null); if [[ $TAG =~ [[:digit:]]+\.[[:digit:]]+ ]]; then export RELEASE_TAG=$TAG; fi
   - export TAG=$(git describe --exact-match $TRAVIS_COMMIT 2>/dev/null); if [[ $TAG =~ [[:digit:]]+\.[[:digit:]]+ ]]; then export RELEASE_TAG=$TAG; fi
   - export COMMIT_MESSAGE=$(git log --format=%B -n1 $TRAVIS_COMMIT)
   - export COMMIT_MESSAGE=$(git log --format=%B -n1 $TRAVIS_COMMIT)
   - if [ ${TRAVIS_JOB_NUMBER##*.} -lt $PACKAGE_JOB_END ] && ([ $RELEASE_TAG ] || (! [[ $TRAVIS_BRANCH =~ [^-]+-[^-]+-CI ]] && echo $COMMIT_MESSAGE |grep -cq '\[ci package\]')); then export PACKAGE_UPLOAD=1; fi
   - if [ ${TRAVIS_JOB_NUMBER##*.} -lt $PACKAGE_JOB_END ] && ([ $RELEASE_TAG ] || (! [[ $TRAVIS_BRANCH =~ [^-]+-[^-]+-CI ]] && echo $COMMIT_MESSAGE |grep -cq '\[ci package\]')); then export PACKAGE_UPLOAD=1; fi
   - git clone --depth 1 --branch strip https://github.com/urho3d/android-ndk.git && export ANDROID_NDK=$(pwd)/android-ndk && if ([ $AVD ] || [ $PACKAGE_UPLOAD ]) && [ $INSTALL ]; then (while :; do echo 'y'; sleep 1; done) |android update sdk --no-ui --all --filter $INSTALL; fi
   - git clone --depth 1 --branch strip https://github.com/urho3d/android-ndk.git && export ANDROID_NDK=$(pwd)/android-ndk && if ([ $AVD ] || [ $PACKAGE_UPLOAD ]) && [ $INSTALL ]; then (while :; do echo 'y'; sleep 1; done) |android update sdk --no-ui --all --filter $INSTALL; fi
-  - if [ "$ABI" == "x86_64" ]; then export C_PATH=$(pwd)/android-ndk/toolchains/x86_64-4.9/prebuilt/linux-x86_64/bin C_PREFIX=x86_64-linux-android; fi
-  - if [ "$ABI" == "x86" ]; then export C_PATH=$(pwd)/android-ndk/toolchains/x86-4.9/prebuilt/linux-x86_64/bin C_PREFIX=i686-linux-android; fi
-  - if [ "$ABI" == "arm64-v8a" ]; then export C_PATH=$(pwd)/android-ndk/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin C_PREFIX=aarch64-linux-android; fi
-  - if [ "$ABI" == "armeabi-v7a" ]; then export C_PATH=$(pwd)/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin C_PREFIX=arm-linux-androideabi; fi
+  - if [ "$ANDROID_ABI" == "x86_64" ]; then export C_PATH=$(pwd)/android-ndk/toolchains/x86_64-4.9/prebuilt/linux-x86_64/bin C_PREFIX=x86_64-linux-android; fi
+  - if [ "$ANDROID_ABI" == "x86" ]; then export C_PATH=$(pwd)/android-ndk/toolchains/x86-4.9/prebuilt/linux-x86_64/bin C_PREFIX=i686-linux-android; fi
+  - if [ "$ANDROID_ABI" == "arm64-v8a" ]; then export C_PATH=$(pwd)/android-ndk/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin C_PREFIX=aarch64-linux-android; fi
+  - if [ "$ANDROID_ABI" == "armeabi-v7a" ]; then export C_PATH=$(pwd)/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin C_PREFIX=arm-linux-androideabi; fi
   - export PATH=$(whereis -b ccache |grep -o '\S*lib\S*'):$C_PATH:$PATH; for f in $C_PATH/$C_PREFIX-{gcc,g++}; do touch -d "2015-01-01 00:00:00 +0800" $f; done
   - export PATH=$(whereis -b ccache |grep -o '\S*lib\S*'):$C_PATH:$PATH; for f in $C_PATH/$C_PREFIX-{gcc,g++}; do touch -d "2015-01-01 00:00:00 +0800" $f; done
   - rake ci_setup_cache
   - rake ci_setup_cache
 script: rake ci && if [ $PACKAGE_UPLOAD ]; then rake ci_package_upload; fi
 script: rake ci && if [ $PACKAGE_UPLOAD ]; then rake ci_package_upload; fi
@@ -268,7 +268,7 @@ env:
   global:
   global:
     - secure: DE9IUM+pIV757GU0ccfDJhA752442pKu3DyBthrzHW9+GbsqbfuJOx045CYNN5vOWutFPC0A51B9WxhLNpXXqD3mfU8MhP1gkF7SskrHvcAPrCyfdqZf1Q8XDP5phm2KbHhhwxQMYmmicd6yj8DPNy2wRoSgPSDp/ZUDk51XZDU=
     - secure: DE9IUM+pIV757GU0ccfDJhA752442pKu3DyBthrzHW9+GbsqbfuJOx045CYNN5vOWutFPC0A51B9WxhLNpXXqD3mfU8MhP1gkF7SskrHvcAPrCyfdqZf1Q8XDP5phm2KbHhhwxQMYmmicd6yj8DPNy2wRoSgPSDp/ZUDk51XZDU=
     - secure: ecj/PwpbHkH9AYFsc2TMeRuNm5E3xMM8A0x4AcGhzpwDuZWdFx3R1T4G9u45Z5aUyTJWGqOeX1JPaEVVFZuYnNBKRy0kmiUrM9EE0j7WsT57K48tP1ysn2ynyvHgbYkKOfYR0t8XAMWTBbulT9DVVk3DS69//2WgiXGDVUEJTyI=
     - secure: ecj/PwpbHkH9AYFsc2TMeRuNm5E3xMM8A0x4AcGhzpwDuZWdFx3R1T4G9u45Z5aUyTJWGqOeX1JPaEVVFZuYnNBKRy0kmiUrM9EE0j7WsT57K48tP1ysn2ynyvHgbYkKOfYR0t8XAMWTBbulT9DVVk3DS69//2WgiXGDVUEJTyI=
-    - NUMJOBS=4
+    - numjobs=4
     - RPI=1
     - RPI=1
     - PACKAGE_JOB_END=5
     - PACKAGE_JOB_END=5
     - USE_CCACHE=1
     - USE_CCACHE=1
@@ -310,7 +310,7 @@ env:
   global:
   global:
     - secure: DE9IUM+pIV757GU0ccfDJhA752442pKu3DyBthrzHW9+GbsqbfuJOx045CYNN5vOWutFPC0A51B9WxhLNpXXqD3mfU8MhP1gkF7SskrHvcAPrCyfdqZf1Q8XDP5phm2KbHhhwxQMYmmicd6yj8DPNy2wRoSgPSDp/ZUDk51XZDU=
     - secure: DE9IUM+pIV757GU0ccfDJhA752442pKu3DyBthrzHW9+GbsqbfuJOx045CYNN5vOWutFPC0A51B9WxhLNpXXqD3mfU8MhP1gkF7SskrHvcAPrCyfdqZf1Q8XDP5phm2KbHhhwxQMYmmicd6yj8DPNy2wRoSgPSDp/ZUDk51XZDU=
     - secure: ecj/PwpbHkH9AYFsc2TMeRuNm5E3xMM8A0x4AcGhzpwDuZWdFx3R1T4G9u45Z5aUyTJWGqOeX1JPaEVVFZuYnNBKRy0kmiUrM9EE0j7WsT57K48tP1ysn2ynyvHgbYkKOfYR0t8XAMWTBbulT9DVVk3DS69//2WgiXGDVUEJTyI=
     - secure: ecj/PwpbHkH9AYFsc2TMeRuNm5E3xMM8A0x4AcGhzpwDuZWdFx3R1T4G9u45Z5aUyTJWGqOeX1JPaEVVFZuYnNBKRy0kmiUrM9EE0j7WsT57K48tP1ysn2ynyvHgbYkKOfYR0t8XAMWTBbulT9DVVk3DS69//2WgiXGDVUEJTyI=
-    - NUMJOBS=3
+    - numjobs=3
     - OSX=1
     - OSX=1
     - USE_CCACHE=2
     - USE_CCACHE=2
     - CCACHE_SLOPPINESS=pch_defines,time_macros
     - CCACHE_SLOPPINESS=pch_defines,time_macros
@@ -320,8 +320,8 @@ env:
     - MAKEFILE=1    URHO3D_LIB_TYPE=SHARED URHO3D_DEPLOYMENT_TARGET=generic
     - MAKEFILE=1    URHO3D_LIB_TYPE=SHARED URHO3D_DEPLOYMENT_TARGET=generic
     - XCODE=1       URHO3D_LIB_TYPE=STATIC CMAKE_OSX_DEPLOYMENT_TARGET=10.11 SF_DEFAULT=mac:OSX-64bit-STATIC.tar.gz
     - XCODE=1       URHO3D_LIB_TYPE=STATIC CMAKE_OSX_DEPLOYMENT_TARGET=10.11 SF_DEFAULT=mac:OSX-64bit-STATIC.tar.gz
     - XCODE=1       URHO3D_LIB_TYPE=SHARED CMAKE_OSX_DEPLOYMENT_TARGET=10.11
     - XCODE=1       URHO3D_LIB_TYPE=SHARED CMAKE_OSX_DEPLOYMENT_TARGET=10.11
-    - XCODE=1 IOS=1 URHO3D_LIB_TYPE=STATIC IPHONEOS_DEPLOYMENT_TARGET=9.1 URHO3D_64BIT=0
-    - XCODE=1 IOS=1 URHO3D_LIB_TYPE=STATIC IPHONEOS_DEPLOYMENT_TARGET=9.1
+    - XCODE=1 IOS=1 URHO3D_LIB_TYPE=STATIC IPHONEOS_DEPLOYMENT_TARGET=9.1 sdk=iphonesimulator URHO3D_64BIT=0
+    - XCODE=1 IOS=1 URHO3D_LIB_TYPE=STATIC IPHONEOS_DEPLOYMENT_TARGET=9.1 sdk=iphonesimulator
 matrix:
 matrix:
   fast_finish: true
   fast_finish: true
 before_script:
 before_script:
@@ -342,7 +342,7 @@ after_script: rake ci_teardown_cache
 
 
 ---
 ---
 
 
-branch: {name: Emscripten-CI, active: yes}
+branch: {name: Web-CI, active: yes}
 language: cpp
 language: cpp
 cache: ccache
 cache: ccache
 sudo: false
 sudo: false
@@ -351,8 +351,8 @@ env:
   global:
   global:
     - secure: DE9IUM+pIV757GU0ccfDJhA752442pKu3DyBthrzHW9+GbsqbfuJOx045CYNN5vOWutFPC0A51B9WxhLNpXXqD3mfU8MhP1gkF7SskrHvcAPrCyfdqZf1Q8XDP5phm2KbHhhwxQMYmmicd6yj8DPNy2wRoSgPSDp/ZUDk51XZDU=
     - secure: DE9IUM+pIV757GU0ccfDJhA752442pKu3DyBthrzHW9+GbsqbfuJOx045CYNN5vOWutFPC0A51B9WxhLNpXXqD3mfU8MhP1gkF7SskrHvcAPrCyfdqZf1Q8XDP5phm2KbHhhwxQMYmmicd6yj8DPNy2wRoSgPSDp/ZUDk51XZDU=
     - secure: ecj/PwpbHkH9AYFsc2TMeRuNm5E3xMM8A0x4AcGhzpwDuZWdFx3R1T4G9u45Z5aUyTJWGqOeX1JPaEVVFZuYnNBKRy0kmiUrM9EE0j7WsT57K48tP1ysn2ynyvHgbYkKOfYR0t8XAMWTBbulT9DVVk3DS69//2WgiXGDVUEJTyI=
     - secure: ecj/PwpbHkH9AYFsc2TMeRuNm5E3xMM8A0x4AcGhzpwDuZWdFx3R1T4G9u45Z5aUyTJWGqOeX1JPaEVVFZuYnNBKRy0kmiUrM9EE0j7WsT57K48tP1ysn2ynyvHgbYkKOfYR0t8XAMWTBbulT9DVVk3DS69//2WgiXGDVUEJTyI=
-    - NUMJOBS=3
-    - HTML5=1
+    - numjobs=3
+    - WEB=1
     - EMSCRIPTEN_SHARE_DATA=1
     - EMSCRIPTEN_SHARE_DATA=1
     - USE_CCACHE=1
     - USE_CCACHE=1
     - CCACHE_SLOPPINESS=pch_defines,time_macros
     - CCACHE_SLOPPINESS=pch_defines,time_macros

+ 6 - 5
CMake/Modules/FindUrho3D.cmake

@@ -70,12 +70,13 @@ else ()
     if (NOT URHO3D_HOME AND DEFINED ENV{URHO3D_HOME})
     if (NOT URHO3D_HOME AND DEFINED ENV{URHO3D_HOME})
         file (TO_CMAKE_PATH "$ENV{URHO3D_HOME}" URHO3D_HOME)
         file (TO_CMAKE_PATH "$ENV{URHO3D_HOME}" URHO3D_HOME)
     endif ()
     endif ()
-    # If either of the URHO3D_64BIT or URHO3D_LIB_TYPE or URHO3D_HOME build options changes then invalidate all the caches
+    # Convert to integer literal to match it with our internal cache representation; it also will be used as foreach loop control variable
     if (URHO3D_64BIT)
     if (URHO3D_64BIT)
-        set (URHO3D_64BIT 1)    # Convert to integer literal to match it with our internal cache representation
+        set (URHO3D_64BIT 1)
     else ()
     else ()
         set (URHO3D_64BIT 0)
         set (URHO3D_64BIT 0)
     endif ()
     endif ()
+    # If either of the URHO3D_64BIT or URHO3D_LIB_TYPE or URHO3D_HOME build options changes then invalidate all the caches
     if (NOT URHO3D_64BIT EQUAL URHO3D_FOUND_64BIT OR NOT URHO3D_LIB_TYPE STREQUAL URHO3D_FOUND_LIB_TYPE OR NOT URHO3D_BASE_INCLUDE_DIR MATCHES "^${URHO3D_HOME}/include/Urho3D$")
     if (NOT URHO3D_64BIT EQUAL URHO3D_FOUND_64BIT OR NOT URHO3D_LIB_TYPE STREQUAL URHO3D_FOUND_LIB_TYPE OR NOT URHO3D_BASE_INCLUDE_DIR MATCHES "^${URHO3D_HOME}/include/Urho3D$")
         unset (URHO3D_BASE_INCLUDE_DIR CACHE)
         unset (URHO3D_BASE_INCLUDE_DIR CACHE)
         unset (URHO3D_LIBRARIES CACHE)
         unset (URHO3D_LIBRARIES CACHE)
@@ -109,7 +110,7 @@ else ()
             endif ()
             endif ()
         endif ()
         endif ()
         # Cater for the shared library extension in Emscripten build which is ".bc" instead of ".so"
         # Cater for the shared library extension in Emscripten build which is ".bc" instead of ".so"
-        if (EMSCRIPTEN)
+        if (WEB)
             string (REPLACE .so .bc CMAKE_FIND_LIBRARY_SUFFIXES "${CMAKE_FIND_LIBRARY_SUFFIXES}")   # Stringify for string replacement
             string (REPLACE .so .bc CMAKE_FIND_LIBRARY_SUFFIXES "${CMAKE_FIND_LIBRARY_SUFFIXES}")   # Stringify for string replacement
         endif ()
         endif ()
         # The PATH_SUFFIX does not work for CMake on Windows host system, it actually needs a prefix instead
         # The PATH_SUFFIX does not work for CMake on Windows host system, it actually needs a prefix instead
@@ -166,7 +167,7 @@ else ()
     set (AUTO_DISCOVER_VARS URHO3D_OPENGL URHO3D_D3D11 URHO3D_SSE URHO3D_DATABASE_ODBC URHO3D_DATABASE_SQLITE)
     set (AUTO_DISCOVER_VARS URHO3D_OPENGL URHO3D_D3D11 URHO3D_SSE URHO3D_DATABASE_ODBC URHO3D_DATABASE_SQLITE)
     foreach (ABI_64BIT RANGE ${URHO3D_64BIT} 0)
     foreach (ABI_64BIT RANGE ${URHO3D_64BIT} 0)
         # Break if the compiler is not multilib-capable and the ABI is not its native
         # Break if the compiler is not multilib-capable and the ABI is not its native
-        if ((MSVC OR MINGW OR ANDROID OR RPI OR EMSCRIPTEN) AND NOT ABI_64BIT EQUAL URHO3D_DEFAULT_64BIT)
+        if ((MSVC OR MINGW OR ANDROID OR RPI OR WEB) AND NOT ABI_64BIT EQUAL URHO3D_DEFAULT_64BIT)
             break ()
             break ()
         endif ()
         endif ()
         # Set to search in 'lib' or 'lib64' based on the ABI being tested
         # Set to search in 'lib' or 'lib64' based on the ABI being tested
@@ -217,7 +218,7 @@ else ()
         endif ()
         endif ()
         # Ensure the module has found the library with the right ABI for the chosen compiler and URHO3D_64BIT build option (if specified)
         # Ensure the module has found the library with the right ABI for the chosen compiler and URHO3D_64BIT build option (if specified)
         if (URHO3D_LIBRARIES AND NOT URHO3D_COMPILE_RESULT)
         if (URHO3D_LIBRARIES AND NOT URHO3D_COMPILE_RESULT)
-            if (NOT (MSVC OR MINGW OR ANDROID OR RPI OR EMSCRIPTEN) AND NOT ABI_64BIT)
+            if (NOT (MSVC OR MINGW OR ANDROID OR RPI OR WEB) AND NOT ABI_64BIT)
                 set (COMPILER_32BIT_FLAG -DCOMPILE_DEFINITIONS:STRING=-m32)
                 set (COMPILER_32BIT_FLAG -DCOMPILE_DEFINITIONS:STRING=-m32)
             endif ()
             endif ()
             # Below variables are loop invariant but there is no harm to keep them here
             # Below variables are loop invariant but there is no harm to keep them here

+ 34 - 32
CMake/Modules/Urho3D-CMake-common.cmake

@@ -103,12 +103,12 @@ if (NOT DEFINED URHO3D_DEFAULT_64BIT)  # Only do this once in the initial config
     endif ()
     endif ()
     set (URHO3D_DEFAULT_64BIT ${URHO3D_DEFAULT_64BIT} CACHE INTERNAL "Default value for URHO3D_64BIT build option")
     set (URHO3D_DEFAULT_64BIT ${URHO3D_DEFAULT_64BIT} CACHE INTERNAL "Default value for URHO3D_64BIT build option")
 endif ()
 endif ()
-cmake_dependent_option (URHO3D_64BIT "Enable 64-bit build, the default is set based on the native ABI of the chosen compiler toolchain" ${URHO3D_DEFAULT_64BIT} "NOT MSVC AND NOT MINGW AND NOT ANDROID AND NOT RPI AND NOT EMSCRIPTEN" ${URHO3D_DEFAULT_64BIT})
-cmake_dependent_option (URHO3D_ANGELSCRIPT "Enable AngelScript scripting support" TRUE "NOT EMSCRIPTEN" FALSE)
+cmake_dependent_option (URHO3D_64BIT "Enable 64-bit build, the default is set based on the native ABI of the chosen compiler toolchain" ${URHO3D_DEFAULT_64BIT} "NOT MSVC AND NOT MINGW AND NOT ANDROID AND NOT RPI AND NOT WEB" ${URHO3D_DEFAULT_64BIT})
+cmake_dependent_option (URHO3D_ANGELSCRIPT "Enable AngelScript scripting support" TRUE "NOT WEB" FALSE)
 option (URHO3D_LUA "Enable additional Lua scripting support" TRUE)
 option (URHO3D_LUA "Enable additional Lua scripting support" TRUE)
-cmake_dependent_option (URHO3D_LUAJIT "Enable Lua scripting support using LuaJIT (check LuaJIT's CMakeLists.txt for more options)" FALSE "NOT EMSCRIPTEN" FALSE)
+cmake_dependent_option (URHO3D_LUAJIT "Enable Lua scripting support using LuaJIT (check LuaJIT's CMakeLists.txt for more options)" FALSE "NOT WEB" FALSE)
 option (URHO3D_NAVIGATION "Enable navigation support" TRUE)
 option (URHO3D_NAVIGATION "Enable navigation support" TRUE)
-cmake_dependent_option (URHO3D_NETWORK "Enable networking support" TRUE "NOT EMSCRIPTEN" FALSE)
+cmake_dependent_option (URHO3D_NETWORK "Enable networking support" TRUE "NOT WEB" FALSE)
 option (URHO3D_PHYSICS "Enable physics support" TRUE)
 option (URHO3D_PHYSICS "Enable physics support" TRUE)
 option (URHO3D_URHO2D "Enable 2D graphics and physics support" TRUE)
 option (URHO3D_URHO2D "Enable 2D graphics and physics support" TRUE)
 if (IOS OR (RPI AND "${RPI_ABI}" MATCHES NEON))    # Stringify in case RPI_ABI is not set explicitly
 if (IOS OR (RPI AND "${RPI_ABI}" MATCHES NEON))    # Stringify in case RPI_ABI is not set explicitly
@@ -169,13 +169,13 @@ if (CMAKE_PROJECT_NAME STREQUAL Urho3D)
                 message (WARNING "Disabling SSE by default due to MinGW version. It is recommended to upgrade to MinGW with GCC >= 4.9.1. You can also try to re-enable SSE with CMake option -DURHO3D_SSE=1, but this may result in compile errors.")
                 message (WARNING "Disabling SSE by default due to MinGW version. It is recommended to upgrade to MinGW with GCC >= 4.9.1. You can also try to re-enable SSE with CMake option -DURHO3D_SSE=1, but this may result in compile errors.")
                 set (URHO3D_DEFAULT_SSE FALSE)
                 set (URHO3D_DEFAULT_SSE FALSE)
             endif ()
             endif ()
-        elseif (EMSCRIPTEN)
+        elseif (WEB)
             # In Emscripten, default to false for targeting SSE2, since the SIMD.js specification is not yet widely adopted in browsers
             # In Emscripten, default to false for targeting SSE2, since the SIMD.js specification is not yet widely adopted in browsers
             set (URHO3D_DEFAULT_SSE FALSE)
             set (URHO3D_DEFAULT_SSE FALSE)
         endif ()
         endif ()
         set (URHO3D_DEFAULT_SSE ${URHO3D_DEFAULT_SSE} CACHE INTERNAL "Default value for URHO3D_SSE build option")
         set (URHO3D_DEFAULT_SSE ${URHO3D_DEFAULT_SSE} CACHE INTERNAL "Default value for URHO3D_SSE build option")
     endif ()
     endif ()
-    cmake_dependent_option (URHO3D_SSE "Enable SSE2 instruction set (HTML5 and Intel platforms only including Android on Intel Atom); default to true on Intel and false on HTML5; the effective SSE level could be higher, see also URHO3D_DEPLOYMENT_TARGET and CMAKE_OSX_DEPLOYMENT_TARGET build options" ${URHO3D_DEFAULT_SSE} "NOT ARM" FALSE)
+    cmake_dependent_option (URHO3D_SSE "Enable SSE2 instruction set (Web and Intel platforms only including Android on Intel Atom); default to true on Intel and false on Web platform; the effective SSE level could be higher, see also URHO3D_DEPLOYMENT_TARGET and CMAKE_OSX_DEPLOYMENT_TARGET build options" ${URHO3D_DEFAULT_SSE} "NOT ARM" FALSE)
     cmake_dependent_option (URHO3D_LUAJIT_AMALG "Enable LuaJIT amalgamated build (LuaJIT only)" FALSE "URHO3D_LUAJIT" FALSE)
     cmake_dependent_option (URHO3D_LUAJIT_AMALG "Enable LuaJIT amalgamated build (LuaJIT only)" FALSE "URHO3D_LUAJIT" FALSE)
     cmake_dependent_option (URHO3D_SAFE_LUA "Enable Lua C++ wrapper safety checks (Lua/LuaJIT only)" FALSE "URHO3D_LUA OR URHO3D_LUAJIT" FALSE)
     cmake_dependent_option (URHO3D_SAFE_LUA "Enable Lua C++ wrapper safety checks (Lua/LuaJIT only)" FALSE "URHO3D_LUA OR URHO3D_LUAJIT" FALSE)
     if (CMAKE_BUILD_TYPE STREQUAL Release OR CMAKE_CONFIGURATION_TYPES)
     if (CMAKE_BUILD_TYPE STREQUAL Release OR CMAKE_CONFIGURATION_TYPES)
@@ -187,14 +187,14 @@ if (CMAKE_PROJECT_NAME STREQUAL Urho3D)
     option (URHO3D_SAMPLES "Build sample applications" TRUE)
     option (URHO3D_SAMPLES "Build sample applications" TRUE)
     option (URHO3D_UPDATE_SOURCE_TREE "Enable commands to copy back some of the generated build artifacts from build tree to source tree to facilitate devs to push them as part of a commit (for library devs with push right only)")
     option (URHO3D_UPDATE_SOURCE_TREE "Enable commands to copy back some of the generated build artifacts from build tree to source tree to facilitate devs to push them as part of a commit (for library devs with push right only)")
     option (URHO3D_BINDINGS "Enable API binding generation support for script subystems")
     option (URHO3D_BINDINGS "Enable API binding generation support for script subystems")
-    cmake_dependent_option (URHO3D_CLANG_TOOLS "Build Clang tools (native only)" FALSE "NOT RPI AND NOT IOS AND NOT ANDROID AND NOT EMSCRIPTEN" FALSE)
+    cmake_dependent_option (URHO3D_CLANG_TOOLS "Build Clang tools (native only)" FALSE "NOT RPI AND NOT IOS AND NOT ANDROID AND NOT WEB" FALSE)
     mark_as_advanced (URHO3D_UPDATE_SOURCE_TREE URHO3D_BINDINGS URHO3D_CLANG_TOOLS)
     mark_as_advanced (URHO3D_UPDATE_SOURCE_TREE URHO3D_BINDINGS URHO3D_CLANG_TOOLS)
-    cmake_dependent_option (URHO3D_TOOLS "Build tools (native and RPI only)" TRUE "NOT IOS AND NOT ANDROID AND NOT EMSCRIPTEN" FALSE)
-    cmake_dependent_option (URHO3D_EXTRAS "Build extras (native and RPI only)" FALSE "NOT IOS AND NOT ANDROID AND NOT EMSCRIPTEN" FALSE)
+    cmake_dependent_option (URHO3D_TOOLS "Build tools (native and RPI only)" TRUE "NOT IOS AND NOT ANDROID AND NOT WEB" FALSE)
+    cmake_dependent_option (URHO3D_EXTRAS "Build extras (native and RPI only)" FALSE "NOT IOS AND NOT ANDROID AND NOT WEB" FALSE)
     option (URHO3D_DOCS "Generate documentation as part of normal build")
     option (URHO3D_DOCS "Generate documentation as part of normal build")
     option (URHO3D_DOCS_QUIET "Generate documentation as part of normal build, suppress generation process from sending anything to stdout")
     option (URHO3D_DOCS_QUIET "Generate documentation as part of normal build, suppress generation process from sending anything to stdout")
     option (URHO3D_PCH "Enable PCH support" TRUE)
     option (URHO3D_PCH "Enable PCH support" TRUE)
-    cmake_dependent_option (URHO3D_DATABASE_ODBC "Enable Database support with ODBC, requires vendor-specific ODBC driver" FALSE "NOT IOS AND NOT ANDROID AND NOT EMSCRIPTEN" FALSE)
+    cmake_dependent_option (URHO3D_DATABASE_ODBC "Enable Database support with ODBC, requires vendor-specific ODBC driver" FALSE "NOT IOS AND NOT ANDROID AND NOT WEB" FALSE)
     option (URHO3D_DATABASE_SQLITE "Enable Database support with SQLite embedded")
     option (URHO3D_DATABASE_SQLITE "Enable Database support with SQLite embedded")
     cmake_dependent_option (URHO3D_MINIDUMPS "Enable minidumps on crash (VS only)" TRUE "MSVC" FALSE)
     cmake_dependent_option (URHO3D_MINIDUMPS "Enable minidumps on crash (VS only)" TRUE "MSVC" FALSE)
     option (URHO3D_FILEWATCHER "Enable filewatcher support" TRUE)
     option (URHO3D_FILEWATCHER "Enable filewatcher support" TRUE)
@@ -214,18 +214,18 @@ else ()
         include_directories (${URHO3D_INCLUDE_DIRS})
         include_directories (${URHO3D_INCLUDE_DIRS})
     endif ()
     endif ()
 endif ()
 endif ()
-option (URHO3D_PACKAGING "Enable resources packaging support, on Emscripten default to 1, on other platforms default to 0" ${EMSCRIPTEN})
+option (URHO3D_PACKAGING "Enable resources packaging support, on Emscripten default to 1, on other platforms default to 0" ${WEB})
 option (URHO3D_PROFILING "Enable profiling support" TRUE)
 option (URHO3D_PROFILING "Enable profiling support" TRUE)
 option (URHO3D_LOGGING "Enable logging support" TRUE)
 option (URHO3D_LOGGING "Enable logging support" TRUE)
 # Emscripten thread support is yet experimental; default false
 # Emscripten thread support is yet experimental; default false
-if (NOT EMSCRIPTEN)
+if (NOT WEB)
     option (URHO3D_THREADING "Enable threading support" TRUE)
     option (URHO3D_THREADING "Enable threading support" TRUE)
 else ()
 else ()
     option (URHO3D_THREADING "Enable threading support" FALSE)
     option (URHO3D_THREADING "Enable threading support" FALSE)
 endif ()
 endif ()
 option (URHO3D_TESTING "Enable testing support")
 option (URHO3D_TESTING "Enable testing support")
 if (URHO3D_TESTING)
 if (URHO3D_TESTING)
-    if (EMSCRIPTEN)
+    if (WEB)
         set (DEFAULT_TIMEOUT 10)
         set (DEFAULT_TIMEOUT 10)
         set (EMSCRIPTEN_EMRUN_BROWSER firefox CACHE STRING "Specify the particular browser to be spawned by emrun during testing (Emscripten cross-compiling build only), use 'emrun --list_browsers' command to get the list of possible values")
         set (EMSCRIPTEN_EMRUN_BROWSER firefox CACHE STRING "Specify the particular browser to be spawned by emrun during testing (Emscripten cross-compiling build only), use 'emrun --list_browsers' command to get the list of possible values")
     else ()
     else ()
@@ -299,13 +299,13 @@ if (RPI)
     endif ()
     endif ()
     set (RPI_ABI ${RPI_ABI} CACHE STRING "Specify target ABI (RPI build only), possible values are armeabi-v6 (default for RPI 1), armeabi-v7a (default for RPI 2), armeabi-v7a with NEON, and armeabi-v7a with VFPV4" FORCE)
     set (RPI_ABI ${RPI_ABI} CACHE STRING "Specify target ABI (RPI build only), possible values are armeabi-v6 (default for RPI 1), armeabi-v7a (default for RPI 2), armeabi-v7a with NEON, and armeabi-v7a with VFPV4" FORCE)
 endif ()
 endif ()
-if (EMSCRIPTEN)     # CMAKE_CROSSCOMPILING is always true for Emscripten
+if (WEB)     # CMAKE_CROSSCOMPILING is always true for Emscripten
     set (EMSCRIPTEN_ROOT_PATH "" CACHE PATH "Root path to Emscripten cross-compiler tools (Emscripten cross-compiling build only)")
     set (EMSCRIPTEN_ROOT_PATH "" CACHE PATH "Root path to Emscripten cross-compiler tools (Emscripten cross-compiling build only)")
     set (EMSCRIPTEN_SYSROOT "" CACHE PATH "Path to Emscripten system root (Emscripten cross-compiling build only)")
     set (EMSCRIPTEN_SYSROOT "" CACHE PATH "Path to Emscripten system root (Emscripten cross-compiling build only)")
     option (EMSCRIPTEN_ALLOW_MEMORY_GROWTH "Enable memory growing based on application demand (Emscripten cross-compiling build only)")
     option (EMSCRIPTEN_ALLOW_MEMORY_GROWTH "Enable memory growing based on application demand (Emscripten cross-compiling build only)")
     math (EXPR EMSCRIPTEN_TOTAL_MEMORY "32 * 1024 * 1024")     # This option is ignored when EMSCRIPTEN_ALLOW_MEMORY_GROWTH option is set
     math (EXPR EMSCRIPTEN_TOTAL_MEMORY "32 * 1024 * 1024")     # This option is ignored when EMSCRIPTEN_ALLOW_MEMORY_GROWTH option is set
     set (EMSCRIPTEN_TOTAL_MEMORY ${EMSCRIPTEN_TOTAL_MEMORY} CACHE STRING "Specify the total size of memory to be used (Emscripten cross-compiling build only); default to 33554432 (32MB), this option is ignored when EMSCRIPTEN_ALLOW_MEMORY_GROWTH=1")
     set (EMSCRIPTEN_TOTAL_MEMORY ${EMSCRIPTEN_TOTAL_MEMORY} CACHE STRING "Specify the total size of memory to be used (Emscripten cross-compiling build only); default to 33554432 (32MB), this option is ignored when EMSCRIPTEN_ALLOW_MEMORY_GROWTH=1")
-    cmake_dependent_option (EMSCRIPTEN_SHARE_DATA "Enable sharing data file support (Emscripten cross-compiling build only)" FALSE "EMSCRIPTEN" FALSE)
+    cmake_dependent_option (EMSCRIPTEN_SHARE_DATA "Enable sharing data file support (Emscripten cross-compiling build only)" FALSE "WEB" FALSE)
 endif ()
 endif ()
 # Constrain the build option values in cmake-gui, if applicable
 # Constrain the build option values in cmake-gui, if applicable
 if (CMAKE_VERSION VERSION_GREATER 2.8 OR CMAKE_VERSION VERSION_EQUAL 2.8)
 if (CMAKE_VERSION VERSION_GREATER 2.8 OR CMAKE_VERSION VERSION_EQUAL 2.8)
@@ -400,7 +400,7 @@ if (URHO3D_THREADING)
 endif ()
 endif ()
 
 
 # Add definitions for Emscripten
 # Add definitions for Emscripten
-if (EMSCRIPTEN)
+if (WEB)
     add_definitions (-DNO_POPEN)
     add_definitions (-DNO_POPEN)
 endif ()
 endif ()
 
 
@@ -590,7 +590,7 @@ else ()
             set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${RPI_CFLAGS}")
             set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${RPI_CFLAGS}")
             set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${RPI_CFLAGS}")
             set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${RPI_CFLAGS}")
         else ()
         else ()
-            if (NOT XCODE AND NOT EMSCRIPTEN)
+            if (NOT XCODE AND NOT WEB)
                 # This may influence the effective SSE level when URHO3D_SSE is on as well
                 # This may influence the effective SSE level when URHO3D_SSE is on as well
                 set (URHO3D_DEPLOYMENT_TARGET native CACHE STRING "Specify the minimum CPU type on which the target binaries are to be deployed (Linux, MinGW, and non-Xcode OSX native build only), see GCC/Clang's -march option for possible values; Use 'generic' for targeting a wide range of generic processors")
                 set (URHO3D_DEPLOYMENT_TARGET native CACHE STRING "Specify the minimum CPU type on which the target binaries are to be deployed (Linux, MinGW, and non-Xcode OSX native build only), see GCC/Clang's -march option for possible values; Use 'generic' for targeting a wide range of generic processors")
                 if (NOT URHO3D_DEPLOYMENT_TARGET STREQUAL generic)
                 if (NOT URHO3D_DEPLOYMENT_TARGET STREQUAL generic)
@@ -612,7 +612,7 @@ else ()
             set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${DASH_MBIT}")
             set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${DASH_MBIT}")
             set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${DASH_MBIT}")
             set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${DASH_MBIT}")
         endif ()
         endif ()
-        if (EMSCRIPTEN)
+        if (WEB)
             # Emscripten-specific setup
             # Emscripten-specific setup
             set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-warn-absolute-paths -Wno-unknown-warning-option")
             set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-warn-absolute-paths -Wno-unknown-warning-option")
             set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-warn-absolute-paths -Wno-unknown-warning-option")
             set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-warn-absolute-paths -Wno-unknown-warning-option")
@@ -1047,7 +1047,7 @@ macro (setup_executable)
     endif ()
     endif ()
     # Need to check if the destination variable is defined first because this macro could be called by downstream project that does not wish to install anything
     # Need to check if the destination variable is defined first because this macro could be called by downstream project that does not wish to install anything
     if (DEST_RUNTIME_DIR)
     if (DEST_RUNTIME_DIR)
-        if (EMSCRIPTEN)
+        if (WEB)
             # todo: Just use generator-expression when CMake minimum version is 3.0
             # todo: Just use generator-expression when CMake minimum version is 3.0
             if (CMAKE_VERSION VERSION_LESS 3.0)
             if (CMAKE_VERSION VERSION_LESS 3.0)
                 get_target_property (LOCATION ${TARGET_NAME} LOCATION)
                 get_target_property (LOCATION ${TARGET_NAME} LOCATION)
@@ -1198,7 +1198,7 @@ macro (setup_main_executable)
             get_filename_component (NAME ${DIR} NAME)
             get_filename_component (NAME ${DIR} NAME)
             set (RESOURCE_${DIR}_PATHNAME ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${NAME}.pak)
             set (RESOURCE_${DIR}_PATHNAME ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${NAME}.pak)
             list (APPEND RESOURCE_PAKS ${RESOURCE_${DIR}_PATHNAME})
             list (APPEND RESOURCE_PAKS ${RESOURCE_${DIR}_PATHNAME})
-            if (EMSCRIPTEN AND NOT EMSCRIPTEN_SHARE_DATA)
+            if (WEB AND NOT EMSCRIPTEN_SHARE_DATA)
                 # Set the custom EMCC_OPTION property to preload the *.pak individually
                 # Set the custom EMCC_OPTION property to preload the *.pak individually
                 set_source_files_properties (${RESOURCE_${DIR}_PATHNAME} PROPERTIES EMCC_OPTION preload-file EMCC_FILE_ALIAS "@/${NAME}.pak --use-preload-cache")
                 set_source_files_properties (${RESOURCE_${DIR}_PATHNAME} PROPERTIES EMCC_OPTION preload-file EMCC_FILE_ALIAS "@/${NAME}.pak --use-preload-cache")
             endif ()
             endif ()
@@ -1212,7 +1212,7 @@ macro (setup_main_executable)
         endif ()
         endif ()
         set (PACKAGING_COMMENT " and packaging")
         set (PACKAGING_COMMENT " and packaging")
         set_property (SOURCE ${RESOURCE_PAKS} PROPERTY GENERATED TRUE)
         set_property (SOURCE ${RESOURCE_PAKS} PROPERTY GENERATED TRUE)
-        if (EMSCRIPTEN)
+        if (WEB)
             # Check if shell-file is already added in source files list by downstream project
             # Check if shell-file is already added in source files list by downstream project
             if (NOT CMAKE_PROJECT_NAME STREQUAL Urho3D)
             if (NOT CMAKE_PROJECT_NAME STREQUAL Urho3D)
                 foreach (FILE ${SOURCE_FILES})
                 foreach (FILE ${SOURCE_FILES})
@@ -1321,7 +1321,7 @@ macro (setup_main_executable)
                 list (APPEND TARGET_PROPERTIES MACOSX_BUNDLE_INFO_PLIST MacOSXBundleInfo.plist.template)
                 list (APPEND TARGET_PROPERTIES MACOSX_BUNDLE_INFO_PLIST MacOSXBundleInfo.plist.template)
             endif ()
             endif ()
             setup_macosx_linker_flags (CMAKE_EXE_LINKER_FLAGS)
             setup_macosx_linker_flags (CMAKE_EXE_LINKER_FLAGS)
-        elseif (EMSCRIPTEN)
+        elseif (WEB)
             setup_emscripten_linker_flags (CMAKE_EXE_LINKER_FLAGS)
             setup_emscripten_linker_flags (CMAKE_EXE_LINKER_FLAGS)
         endif ()
         endif ()
         setup_executable (${EXE_TYPE} ${ARG_UNPARSED_ARGUMENTS})
         setup_executable (${EXE_TYPE} ${ARG_UNPARSED_ARGUMENTS})
@@ -1400,7 +1400,7 @@ macro (setup_test)
             set (ARG_NAME ${TARGET_NAME})
             set (ARG_NAME ${TARGET_NAME})
         endif ()
         endif ()
         list (APPEND ARG_OPTIONS -timeout ${URHO3D_TEST_TIMEOUT})
         list (APPEND ARG_OPTIONS -timeout ${URHO3D_TEST_TIMEOUT})
-        if (EMSCRIPTEN)
+        if (WEB)
             if (DEFINED ENV{CI})
             if (DEFINED ENV{CI})
                 # The latency on CI server could be very high at time, so add some adjustment
                 # The latency on CI server could be very high at time, so add some adjustment
                 # If it is not enough causing a test case failure then so be it because it is better that than wait for it and still ends up in build error due to time limit
                 # If it is not enough causing a test case failure then so be it because it is better that than wait for it and still ends up in build error due to time limit
@@ -1429,7 +1429,7 @@ macro (define_dependency_libs TARGET)
             list (APPEND LIBS dl log android)
             list (APPEND LIBS dl log android)
         else ()
         else ()
             # Linux
             # Linux
-            if (NOT EMSCRIPTEN)
+            if (NOT WEB)
                 list (APPEND LIBS dl rt)
                 list (APPEND LIBS dl rt)
             endif ()
             endif ()
             if (RPI)
             if (RPI)
@@ -1447,7 +1447,7 @@ macro (define_dependency_libs TARGET)
 
 
     # Urho3D/LuaJIT external dependency
     # Urho3D/LuaJIT external dependency
     if (URHO3D_LUAJIT AND ${TARGET} MATCHES LuaJIT|Urho3D)
     if (URHO3D_LUAJIT AND ${TARGET} MATCHES LuaJIT|Urho3D)
-        if (NOT WIN32 AND NOT EMSCRIPTEN)
+        if (NOT WIN32 AND NOT WEB)
             list (APPEND LIBS dl m)
             list (APPEND LIBS dl m)
         endif ()
         endif ()
     endif ()
     endif ()
@@ -1714,7 +1714,7 @@ if (ANDROID)
             create_symlink (${CMAKE_SOURCE_DIR}/Android/${I} ${CMAKE_BINARY_DIR}/${I} FALLBACK_TO_COPY)
             create_symlink (${CMAKE_SOURCE_DIR}/Android/${I} ${CMAKE_BINARY_DIR}/${I} FALLBACK_TO_COPY)
         endif ()
         endif ()
     endforeach ()
     endforeach ()
-elseif (EMSCRIPTEN)
+elseif (WEB)
     # Create Urho3D custom HTML shell that also embeds our own project logo
     # Create Urho3D custom HTML shell that also embeds our own project logo
     if (NOT EXISTS ${CMAKE_BINARY_DIR}/Source/shell.html)
     if (NOT EXISTS ${CMAKE_BINARY_DIR}/Source/shell.html)
         file (READ ${EMSCRIPTEN_ROOT_PATH}/src/shell.html SHELL_HTML)
         file (READ ${EMSCRIPTEN_ROOT_PATH}/src/shell.html SHELL_HTML)
@@ -1751,15 +1751,17 @@ endif ()
 if (IOS)
 if (IOS)
     # TODO: can be removed when CMake minimum required has reached 2.8.12
     # TODO: can be removed when CMake minimum required has reached 2.8.12
     if (CMAKE_VERSION VERSION_LESS 2.8.12)
     if (CMAKE_VERSION VERSION_LESS 2.8.12)
-        # Due to a bug in the CMake/Xcode generator (prior to version 2.8.12) where it has wrongly assumed the IOS bundle structure to be the same as MacOSX bundle structure,
+        # Due to a bug in the CMake/Xcode generator (fixed in 2.8.12) where it has wrongly assumed the IOS bundle structure to be the same as MacOSX bundle structure,
         # below temporary fix is required in order to solve the auto-linking issue when dependent libraries are changed
         # below temporary fix is required in order to solve the auto-linking issue when dependent libraries are changed
         list (APPEND POST_CMAKE_FIXES COMMAND sed -i '' 's/\/Contents\/MacOS//g' ${CMAKE_BINARY_DIR}/CMakeScripts/XCODE_DEPEND_HELPER.make || exit 0)
         list (APPEND POST_CMAKE_FIXES COMMAND sed -i '' 's/\/Contents\/MacOS//g' ${CMAKE_BINARY_DIR}/CMakeScripts/XCODE_DEPEND_HELPER.make || exit 0)
     endif ()
     endif ()
-
-    # Due to a bug in the CMake/Xcode generator (still exists in 3.1) that prevents iOS targets (library and bundle) to be installed correctly
-    # (see http://public.kitware.com/Bug/bug_relationship_graph.php?bug_id=12506&graph=dependency),
-    # below temporary fix is required to work around the bug
-    list (APPEND POST_CMAKE_FIXES COMMAND sed -i '' 's/EFFECTIVE_PLATFORM_NAME//g' ${CMAKE_BINARY_DIR}/CMakeScripts/install_postBuildPhase.make* || exit 0)
+    # TODO: can be removed when CMake minimum required has reached 3.4
+    if (CMAKE_VERSION VERSION_LESS 3.4)
+        # Due to a bug in the CMake/Xcode generator (fixed in 3.4) that prevents iOS targets (library and bundle) to be installed correctly
+        # (see http://public.kitware.com/Bug/bug_relationship_graph.php?bug_id=12506&graph=dependency),
+        # below temporary fix is required to work around the bug
+        list (APPEND POST_CMAKE_FIXES COMMAND sed -i '' 's/EFFECTIVE_PLATFORM_NAME//g' ${CMAKE_BINARY_DIR}/CMakeScripts/install_postBuildPhase.make* || exit 0)
+    endif ()
 endif ()
 endif ()
 if (POST_CMAKE_FIXES)
 if (POST_CMAKE_FIXES)
     add_custom_target (POST_CMAKE_FIXES ALL ${POST_CMAKE_FIXES} COMMENT "Applying post-cmake fixes")
     add_custom_target (POST_CMAKE_FIXES ALL ${POST_CMAKE_FIXES} COMMENT "Applying post-cmake fixes")

+ 1 - 1
CMake/Toolchains/emscripten.toolchain.cmake

@@ -128,4 +128,4 @@ if (CMAKE_HOST_WIN32)
     endforeach ()
     endforeach ()
 endif ()
 endif ()
 
 
-set (EMSCRIPTEN 1)
+set (WEB 1)

+ 2 - 2
CMakeLists.txt

@@ -112,8 +112,8 @@ elseif (APPLE)
     set (CPACK_SYSTEM_NAME OSX)
     set (CPACK_SYSTEM_NAME OSX)
 elseif (WIN32)
 elseif (WIN32)
     set (CPACK_GENERATOR ZIP)
     set (CPACK_GENERATOR ZIP)
-elseif (EMSCRIPTEN)
-    set (CPACK_SYSTEM_NAME HTML5)
+elseif (WEB)
+    set (CPACK_SYSTEM_NAME Web)
 elseif (CPACK_SYSTEM_NAME STREQUAL Linux)
 elseif (CPACK_SYSTEM_NAME STREQUAL Linux)
     if (RPI)
     if (RPI)
         set (CPACK_SYSTEM_NAME Raspberry-Pi)
         set (CPACK_SYSTEM_NAME Raspberry-Pi)

+ 1 - 1
Docs/CMakeLists.txt

@@ -135,7 +135,7 @@ if (DOXYGEN_FOUND)
 endif ()
 endif ()
 
 
 # Make sure html output directory exists and not empty
 # Make sure html output directory exists and not empty
-file (WRITE ${CMAKE_CURRENT_BINARY_DIR}/html/Readme.txt "If URHO3D_DOCS build option is not set then use 'make doc' command to re-generate Urho3D documentation before calling 'make install', alternatively use the 'doc' and 'install' built-in targets in an IDE, respectively")
+file (WRITE ${CMAKE_CURRENT_BINARY_DIR}/html/Readme.txt "If the URHO3D_DOCS build option is set then the Urho3D documentation will be built automatically as part of the Urho3D library build. If build option is not set, however, then use 'doc' built-in target to generate the documentation manually (must do this before installing the SDK).\n")
 
 
 # Currently it is not possible to make built-in 'install' target to depend on 'doc' in CMake, therefore 'make doc' command need to be invoked manually before 'make install' in order to install the SDK with complete documentation
 # Currently it is not possible to make built-in 'install' target to depend on 'doc' in CMake, therefore 'make doc' command need to be invoked manually before 'make install' in order to install the SDK with complete documentation
 # Unless, URHO3D_DOCS build option is set in which case the custom 'doc' target is part of the default 'all' target which in turn the 'install' target depends on, so a single 'make install' alone is suffice to install everything
 # Unless, URHO3D_DOCS build option is set in which case the custom 'doc' target is part of the default 'all' target which in turn the 'install' target depends on, so a single 'make install' alone is suffice to install everything

+ 8 - 6
Docs/GettingStarted.dox

@@ -34,7 +34,7 @@ To run Urho3D, the minimum system requirements are:
 
 
 - iOS: OpenGL ES 2.0 capable GPU.
 - iOS: OpenGL ES 2.0 capable GPU.
 
 
-- Emscripten: modern browsers with fast JavaScript engine and HTML5 and WebGL support.
+- Web: modern browsers with fast JavaScript engine and HTML5 and WebGL support.
 
 
 SSE2/NEON requirement can be eliminated by disabling the use of SSE2/NEON instruction set, see URHO3D_SSE and URHO3D_NEON build options below.
 SSE2/NEON requirement can be eliminated by disabling the use of SSE2/NEON instruction set, see URHO3D_SSE and URHO3D_NEON build options below.
 
 
@@ -70,7 +70,7 @@ A number of build options can be defined when invoking the build scripts or when
 |ANDROID              |0|Configure project using Android cross-compiler toolchain (cmake_generic.bat and cmake_generic.sh only), cmake-gui users need to specify Android toolchain file for cross-compiling explicitly|
 |ANDROID              |0|Configure project using Android cross-compiler toolchain (cmake_generic.bat and cmake_generic.sh only), cmake-gui users need to specify Android toolchain file for cross-compiling explicitly|
 |RPI                  |0|Configure project using Raspberry Pi cross-compiler toolchain (cmake_generic.sh only), cmake-gui users need to specify RPI toolchain file for cross-compiling explicitly|
 |RPI                  |0|Configure project using Raspberry Pi cross-compiler toolchain (cmake_generic.sh only), cmake-gui users need to specify RPI toolchain file for cross-compiling explicitly|
 |WIN32                |0|Configure project using MinGW (32-bit or 64-bit) cross-compiler toolchain (cmake_generic.sh only), cmake-gui users need to specify MinGW toolchain file for cross-compiling explicitly|
 |WIN32                |0|Configure project using MinGW (32-bit or 64-bit) cross-compiler toolchain (cmake_generic.sh only), cmake-gui users need to specify MinGW toolchain file for cross-compiling explicitly|
-|EMSCRIPTEN           |0|Configure project using Emscripten cross-compiler toolchain (cmake_generic.bat and cmake_generic.sh only), cmake-gui users need to specify Emscripten toolchain file for cross-compiling explicitly|
+|WEB                  |0|Configure project using Emscripten cross-compiler toolchain (cmake_generic.bat and cmake_generic.sh only), cmake-gui users need to specify Emscripten toolchain file for cross-compiling explicitly|
 |IOS                  |0|Configure project for targeting iOS platform (cmake_generic.sh and cmake-gui only)|
 |IOS                  |0|Configure project for targeting iOS platform (cmake_generic.sh and cmake-gui only)|
 |URHO3D_64BIT         |*|Enable 64-bit build, the default is set based on the native ABI of the chosen compiler toolchain|
 |URHO3D_64BIT         |*|Enable 64-bit build, the default is set based on the native ABI of the chosen compiler toolchain|
 |URHO3D_ANGELSCRIPT   |1|Enable AngelScript scripting support|
 |URHO3D_ANGELSCRIPT   |1|Enable AngelScript scripting support|
@@ -91,7 +91,7 @@ A number of build options can be defined when invoking the build scripts or when
 |URHO3D_PCH           |1|Enable PCH support|
 |URHO3D_PCH           |1|Enable PCH support|
 |URHO3D_DATABASE_ODBC |0|Enable Database support with ODBC, requires vendor-specific ODBC driver|
 |URHO3D_DATABASE_ODBC |0|Enable Database support with ODBC, requires vendor-specific ODBC driver|
 |URHO3D_DATABASE_SQLITE|0|Enable Database support with SQLite embedded|
 |URHO3D_DATABASE_SQLITE|0|Enable Database support with SQLite embedded|
-|URHO3D_SSE           |*|Enable SSE2 instruction set (HTML5 and Intel platforms only including Android on Intel Atom); default to true on Intel and false on HTML5; the effective SSE level could be higher, see also URHO3D_DEPLOYMENT_TARGET and CMAKE_OSX_DEPLOYMENT_TARGET build options|
+|URHO3D_SSE           |*|Enable SSE2 instruction set (Web and Intel platforms only including Android on Intel Atom); default to true on Intel and false on Web platform; the effective SSE level could be higher, see also URHO3D_DEPLOYMENT_TARGET and CMAKE_OSX_DEPLOYMENT_TARGET build options|
 |URHO3D_NEON          |1|Enable NEON instruction set (ARM platforms with NEON only)|
 |URHO3D_NEON          |1|Enable NEON instruction set (ARM platforms with NEON only)|
 |URHO3D_MINIDUMPS     |1|Enable minidumps on crash (VS only)|
 |URHO3D_MINIDUMPS     |1|Enable minidumps on crash (VS only)|
 |URHO3D_FILEWATCHER   |1|Enable filewatcher support|
 |URHO3D_FILEWATCHER   |1|Enable filewatcher support|
@@ -140,7 +140,7 @@ A native build of Urho3D has two steps:
 
 
 -# Run CMake in the root directory (which is also CMake's source tree) with your preferred generator and toolchain specified to generate the build tree. You can use cmake-gui or the provided batch files or shell scripts on the respective host system. All the batch files and shell scripts expect the build tree location to be passed as the first argument, or to execute them in the build tree itself when reconfiguring the existing build tree.\n
 -# Run CMake in the root directory (which is also CMake's source tree) with your preferred generator and toolchain specified to generate the build tree. You can use cmake-gui or the provided batch files or shell scripts on the respective host system. All the batch files and shell scripts expect the build tree location to be passed as the first argument, or to execute them in the build tree itself when reconfiguring the existing build tree.\n
     - Windows: cmake_vs20xx.bat, cmake_mingw.bat, cmake_codeblock.bat, cmake_ninja.bat, or cmake_generic.bat\n
     - Windows: cmake_vs20xx.bat, cmake_mingw.bat, cmake_codeblock.bat, cmake_ninja.bat, or cmake_generic.bat\n
-    - Mac OS X: cmake_macosx.sh, cmake_codeblocks.sh, cmake_ninja.sh, or cmake_generic.sh\n
+    - Mac OS X: cmake_xcode.sh, cmake_codeblocks.sh, cmake_ninja.sh, or cmake_generic.sh\n
     - Linux: cmake_eclipse.sh, cmake_codeblocks.sh, cmake_ninja.sh, or cmake_generic.sh\n
     - Linux: cmake_eclipse.sh, cmake_codeblocks.sh, cmake_ninja.sh, or cmake_generic.sh\n
     - Raspberry Pi: cmake_rpi.sh, cmake_eclipse.sh, cmake_codeblocks.sh, cmake_ninja.sh, or cmake_generic.sh\n
     - Raspberry Pi: cmake_rpi.sh, cmake_eclipse.sh, cmake_codeblocks.sh, cmake_ninja.sh, or cmake_generic.sh\n
 -# Use the IDE of your choice to open the CMake's generated project file or solution file in the build tree. Change the build configuration (Debug/Release) and change the built-in target to ALL_BUILD to build all the targets.\n
 -# Use the IDE of your choice to open the CMake's generated project file or solution file in the build tree. Change the build configuration (Debug/Release) and change the built-in target to ALL_BUILD to build all the targets.\n
@@ -616,9 +616,9 @@ To build:
 rake make [<platform>] [<option>=<value> [<option>=<value>]] [[<platform>_]build_tree=/path/to/build-tree] [numjobs=n] [clean_first] [unfilter]
 rake make [<platform>] [<option>=<value> [<option>=<value>]] [[<platform>_]build_tree=/path/to/build-tree] [numjobs=n] [clean_first] [unfilter]
 \endverbatim
 \endverbatim
 
 
-The default <generator> when not specified is 'generic', which let CMake to detect and choose what generator is available in the host to use. The possible values are: 'codeblocks', 'eclipse', 'macosx', 'ninja', 'vs2008', 'vs2010', 'vs2012', 'vs2013', 'vs2015'.
+The default <generator> when not specified is 'generic', which let CMake to detect and choose what generator is available in the host to use. The possible values are: 'codeblocks', 'eclipse', 'ninja', 'vs2008', 'vs2010', 'vs2012', 'vs2013', 'vs2015', 'xcode'.
 
 
-The default <platform> when not specified is 'native'. The possible values are: 'android', 'emscripten', 'ios', 'mingw', 'rpi'. Naturally this influences the compiler toolchain being used in the generated build tree.
+The default <platform> when not specified is 'native'. The possible values are: 'android', 'web', 'ios', 'mingw', 'rpi'. Naturally this influences the compiler toolchain being used in the generated build tree.
 
 
 When using the 'rake cmake' task, the <option>=\<value> pairs are optional build options supported by our build scripts as usual. However, the format here does not expect a leading '-D' for each pair. When using the 'rake make' task, the <option>=\<value> pairs are optional build options supported by the respective build tools. For example on iOS platform using 'xcodebuild' build tool, one could pass the '-sdk' option as follows: 'rake make ios sdk=iphonesimulator'. Note the absense of leading '-' character in the example. To build a specific built-in target in the project, use the 'target' option, e.g. 'rake make target=install'. In a multi-config project, such as Xcode project or VS solution, use the 'config' option to choose which build configuration to use, e.g. 'rake make config=Release'. For Xcode project building using 'rake make' task, you may optional install the 'xcpretty' filter to address the verbosity of the 'xcodebuild' tool from its standard output stream. On the other hand, pass the 'unfilter' option to get the output from 'xcodebuild' tool unfiltered regardless the 'xcpretty' is installed or not. You can pass the 'clean_first' option to perform a clean build. By default this task invokes the respective build tool to use all the logical CPU cores available, but you can use the 'numjobs' option to override this default.
 When using the 'rake cmake' task, the <option>=\<value> pairs are optional build options supported by our build scripts as usual. However, the format here does not expect a leading '-D' for each pair. When using the 'rake make' task, the <option>=\<value> pairs are optional build options supported by the respective build tools. For example on iOS platform using 'xcodebuild' build tool, one could pass the '-sdk' option as follows: 'rake make ios sdk=iphonesimulator'. Note the absense of leading '-' character in the example. To build a specific built-in target in the project, use the 'target' option, e.g. 'rake make target=install'. In a multi-config project, such as Xcode project or VS solution, use the 'config' option to choose which build configuration to use, e.g. 'rake make config=Release'. For Xcode project building using 'rake make' task, you may optional install the 'xcpretty' filter to address the verbosity of the 'xcodebuild' tool from its standard output stream. On the other hand, pass the 'unfilter' option to get the output from 'xcodebuild' tool unfiltered regardless the 'xcpretty' is installed or not. You can pass the 'clean_first' option to perform a clean build. By default this task invokes the respective build tool to use all the logical CPU cores available, but you can use the 'numjobs' option to override this default.
 
 
@@ -630,6 +630,8 @@ rake cmake URHO3D_LUAJIT=1 && rake make
 rake cmake rpi URHO3D_LUAJIT=1 && rake make rpi
 rake cmake rpi URHO3D_LUAJIT=1 && rake make rpi
 \endcode
 \endcode
 
 
+You can in fact set and export any other key/value pair build options as environment variables to avoid repeating yourself when invoking any of our Rake tasks.
+
 
 
 \page Structure Overall structure
 \page Structure Overall structure
 
 

+ 110 - 184
Rakefile

@@ -40,17 +40,12 @@ task :scaffolding do
   target = ENV['target'] || 'Main'
   target = ENV['target'] || 'Main'
   scaffolding(abs_path, project, target)
   scaffolding(abs_path, project, target)
   abs_path = Pathname.new(abs_path).realpath
   abs_path = Pathname.new(abs_path).realpath
-  puts "\nNew project created in #{abs_path}\n\n"
-  puts "You may need to first set 'URHO3D_HOME' environment variable or use 'URHO3D_HOME' build option to point to your Urho3D build tree or your custom Urho3D SDK installation location."
-  puts "Please see http://urho3d.github.io/documentation/HEAD/_using_library.html for more detail. For example:\n\n"
-  if ENV['OS']
-    puts "set \"URHO3D_HOME=/path/to/Urho3D/build-tree/or/SDK\"\ncd #{abs_path}\nrake cmake URHO3D_LUAJIT=1\nrake make\n\n"
-    puts "Alternatively you can call one of the batch files directly, such as, cmake_generic.bat ../native-Build -DURHO3D_LUAJIT=1 and build using VS IDE"
-  else
-    puts "export URHO3D_HOME=/path/to/Urho3D/build-tree/or/SDK\ncd #{abs_path}\nrake cmake URHO3D_LUAJIT=1\nrake make\n\n"
-    puts "Alternatively you can call one of the shell scripts directly, such as, ./cmake_generic.sh ../native-Build -DURHO3D_LUAJIT=1 && cd ../native-Build && make"
-  end
-  puts "to get a similar result as the last two rake tasks above.\n\n"
+  puts "\nNew project created in #{abs_path}.\n\n"
+  puts "In order to configure and generate your project build tree you may need to first set"
+  puts "'URHO3D_HOME' environment variable or use 'URHO3D_HOME' build option to point to the"
+  puts "Urho3D project build tree or custom Urho3D SDK installation location.\n\n"
+  puts "Please see http://urho3d.github.io/documentation/HEAD/_using_library.html for more detail.\nFor example:\n\n"
+  puts "$ cd #{abs_path}\n$ rake cmake URHO3D_HOME=/path/to/Urho3D/build-tree\n$ rake make\n\n"
 end
 end
 
 
 # Usage: rake cmake [<generator>] [<platform>] [<option>=<value> [<option>=<value>]] [[<platform>_]build_tree=/path/to/build-tree] [fix_scm]
 # Usage: rake cmake [<generator>] [<platform>] [<option>=<value> [<option>=<value>]] [[<platform>_]build_tree=/path/to/build-tree] [fix_scm]
@@ -65,17 +60,21 @@ task :cmake do
   script = 'cmake_generic'
   script = 'cmake_generic'
   platform = 'native'
   platform = 'native'
   build_options = ''
   build_options = ''
+  # TODO: Need to find a way to automatically populate the array with all the Urho3D supported build options, at the moment it only contains those being used in CI
+  ['URHO3D_64BIT', 'URHO3D_LIB_TYPE', 'URHO3D_PCH', 'URHO3D_BINDINGS', 'URHO3D_OPENGL', 'URHO3D_D3D11', 'URHO3D_TESTING', 'URHO3D_TEST_TIMEOUT', 'URHO3D_UPDATE_SOURCE_TREE', 'URHO3D_TOOLS', 'URHO3D_DEPLOYMENT_TARGET', 'URHO3D_USE_LIB64_RPM', 'CMAKE_BUILD_TYPE', 'CMAKE_OSX_DEPLOYMENT_TARGET', 'IOS', 'IPHONEOS_DEPLOYMENT_TARGET', 'WIN32', 'ANDROID', 'ANDROID_ABI', 'ANDROID_NATIVE_API_LEVEL', 'RPI', 'RPI_ABI', 'WEB', 'EMSCRIPTEN_SHARE_DATA', 'EMSCRIPTEN_EMRUN_BROWSER'].each { |var|
+    ARGV << "#{var}=\"#{ENV[var]}\"" if ENV[var] && !ARGV.find { |arg| /#{var}=/ =~ arg }
+  }
   ARGV.each { |option|
   ARGV.each { |option|
     task option.to_sym do ; end; Rake::Task[option].clear   # No-op hack
     task option.to_sym do ; end; Rake::Task[option].clear   # No-op hack
     case option
     case option
     when 'cmake', 'generic'
     when 'cmake', 'generic'
       # do nothing
       # do nothing
-    when 'clean', 'codeblocks', 'eclipse', 'macosx', 'ninja', 'vs2008', 'vs2010', 'vs2012', 'vs2013', 'vs2015'
+    when 'clean', 'codeblocks', 'eclipse', 'ninja', 'vs2008', 'vs2010', 'vs2012', 'vs2013', 'vs2015', 'xcode'
       script = "cmake_#{option}" unless script == 'cmake_clean'
       script = "cmake_#{option}" unless script == 'cmake_clean'
-    when 'android', 'emscripten', 'ios', 'mingw', 'rpi'
+    when 'android', 'web', 'ios', 'mingw', 'rpi'
       platform = option
       platform = option
       build_options = "#{build_options} -D#{option == 'mingw' ? 'WIN32' : option.upcase}=1" unless script == 'cmake_clean'
       build_options = "#{build_options} -D#{option == 'mingw' ? 'WIN32' : option.upcase}=1" unless script == 'cmake_clean'
-      script = 'cmake_macosx' if option == 'ios'
+      script = 'cmake_xcode' if option == 'ios'
       script = 'cmake_mingw' if option == 'mingw' && ENV['OS']
       script = 'cmake_mingw' if option == 'mingw' && ENV['OS']
     when 'fix_scm'
     when 'fix_scm'
       build_options = "#{build_options} --fix-scm" if script == 'cmake_eclipse'
       build_options = "#{build_options} --fix-scm" if script == 'cmake_eclipse'
@@ -100,13 +99,15 @@ task :make do
   cmake_build_options = ''
   cmake_build_options = ''
   build_options = ''
   build_options = ''
   unfilter = false
   unfilter = false
-  ['config', 'target', 'sdk'].each { |var| ARGV << "#{var}=\"#{ENV[var]}\"" if ENV[var] and !ARGV.find { |arg| /#{var}=/ =~ arg } }
+  ['config', 'target', 'sdk'].each { |var|
+    ARGV << "#{var}=\"#{ENV[var]}\"" if ENV[var] && !ARGV.find { |arg| /#{var}=/ =~ arg }
+  }
   ARGV.each { |option|
   ARGV.each { |option|
     task option.to_sym do ; end; Rake::Task[option].clear   # No-op hack
     task option.to_sym do ; end; Rake::Task[option].clear   # No-op hack
     case option
     case option
-    when 'codeblocks', 'eclipse', 'generic', 'macosx', 'make', 'ninja', 'vs2008', 'vs2010', 'vs2012', 'vs2013', 'vs2015'
+    when 'codeblocks', 'eclipse', 'generic', 'make', 'ninja', 'vs2008', 'vs2010', 'vs2012', 'vs2013', 'vs2015', 'xcode'
       # do nothing
       # do nothing
-    when 'android', 'emscripten', 'ios', 'mingw', 'rpi'
+    when 'android', 'web', 'ios', 'mingw', 'rpi'
       platform = option
       platform = option
     when 'clean_first'
     when 'clean_first'
       cmake_build_options = "#{cmake_build_options} --clean-first"
       cmake_build_options = "#{cmake_build_options} --clean-first"
@@ -130,7 +131,7 @@ task :make do
     if !numjobs.empty?
     if !numjobs.empty?
       build_options = "-jobs #{numjobs}#{build_options}"
       build_options = "-jobs #{numjobs}#{build_options}"
     end
     end
-    filter = !unfilter && system('xcpretty -v >/dev/null 2>&1') ? '|xcpretty -c && exit ${PIPESTATUS[0]}' : ''
+    filter = !unfilter && !ARGV.include?('target=RUN_TESTS') && system('xcpretty -v >/dev/null 2>&1') ? '|xcpretty -c && exit ${PIPESTATUS[0]}' : ''
   elsif !Dir.glob("#{build_tree}\\*.sln".gsub(/\\/, '/')).empty?
   elsif !Dir.glob("#{build_tree}\\*.sln".gsub(/\\/, '/')).empty?
     # msbuild
     # msbuild
     numjobs = ":#{numjobs}" unless numjobs.empty?
     numjobs = ":#{numjobs}" unless numjobs.empty?
@@ -148,12 +149,12 @@ task :make do
     if numjobs.empty?
     if numjobs.empty?
       case RUBY_PLATFORM
       case RUBY_PLATFORM
       when /linux/
       when /linux/
-        numjobs = (platform == 'emscripten' ? `grep 'core id' /proc/cpuinfo |sort |uniq |wc -l` : `grep -c processor /proc/cpuinfo`).chomp
+        numjobs = (platform == 'web' ? `grep 'core id' /proc/cpuinfo |sort |uniq |wc -l` : `grep -c processor /proc/cpuinfo`).chomp
       when /darwin/
       when /darwin/
-        numjobs = `sysctl -n hw.#{platform == 'emscripten' ? 'physical' : 'logical'}cpu`.chomp
+        numjobs = `sysctl -n hw.#{platform == 'web' ? 'physical' : 'logical'}cpu`.chomp
       when /win32|mingw|mswin/
       when /win32|mingw|mswin/
         require 'win32ole'
         require 'win32ole'
-        WIN32OLE.connect('winmgmts://').ExecQuery("select NumberOf#{platform == 'emscripten' ? '' : 'Logical'}Processors from Win32_ComputerSystem").each { |out| numjobs = platform == 'emscripten' ? out.NumberOfProcessors : out.NumberOfLogicalProcessors }
+        WIN32OLE.connect('winmgmts://').ExecQuery("select NumberOf#{platform == 'web' ? '' : 'Logical'}Processors from Win32_ComputerSystem").each { |out| numjobs = platform == 'web' ? out.NumberOfProcessors : out.NumberOfLogicalProcessors }
       else
       else
         numjobs = 1
         numjobs = 1
       end
       end
@@ -224,32 +225,74 @@ task :ci do
   data['excluded_sample'].each { |name| ENV["EXCLUDE_SAMPLE_#{name}"] = '1' } if data && data['excluded_sample']
   data['excluded_sample'].each { |name| ENV["EXCLUDE_SAMPLE_#{name}"] = '1' } if data && data['excluded_sample']
   # Unshallow the clone's history when necessary
   # Unshallow the clone's history when necessary
   if ENV['CI'] && ENV['PACKAGE_UPLOAD'] && !ENV['RELEASE_TAG']
   if ENV['CI'] && ENV['PACKAGE_UPLOAD'] && !ENV['RELEASE_TAG']
-    system 'git fetch --unshallow' or abort 'Failed to unshallow cloned repository'
+    system "bash -c 'git fetch --unshallow'" or abort 'Failed to unshallow cloned repository'
+  end
+  # Using out-of-source build tree when on Travis-CI
+  ENV['build_tree'] = '../Build' if ENV['TRAVIS']
+  # Aways use a same build configuration to keep ccache's cache size small; single-config generator needs the option when configuring, while multi-config when building
+  ENV[ENV['XCODE'] ? 'config' : 'CMAKE_BUILD_TYPE'] = 'Release' if ENV['USE_CCACHE']
+  # Only able to test run when targeting 64-bit native Linux platform, 64-bit native OSX platform, and Emscripten platform; and when not packaging due to time constraint
+  # TODO: Run test target on AppVeyor, could not do it now as we have not figured out how to configure its service to interact with desktop
+  ENV['URHO3D_TESTING'] = '1' if ((ENV['LINUX'] && !ENV['URHO3D_64BIT']) || (ENV['OSX'] && !ENV['IOS']) || ENV['WEB']) && !ENV['PACKAGE_UPLOAD']
+  # When not explicitly specified then use generic generator
+  generator = ENV['XCODE'] ? 'xcode' : (ENV['APPVEYOR'] ? 'vs2015' : '')
+  # LuaJIT on MinGW build is not possible on Travis-CI with Ubuntu LTS 12.04 as its GCC cross-compiler version is too old, wait until we have Ubuntu LTS 14.04
+  # The upstream LuaJIT library does not support Android arm64-v8a ABI at the moment but it should be technically possible
+  # LuaJIT on Web platform is not possible and LuaJIT on iOS platform is not allowed
+  jit = (ENV['WIN32'] && ENV['TRAVIS']) || (ENV['ANDROID'] && ENV['ABI'] == 'arm64-v8a') || ENV['WEB'] || ENV['IOS'] ? '' : 'JIT=1 URHO3D_LUAJIT_AMALG='
+  system "bash -c 'rake cmake #{generator} URHO3D_LUA#{jit}=1 URHO3D_DATABASE_SQLITE=1 URHO3D_EXTRAS=1'" or abort 'Failed to configure Urho3D library build'
+  if ENV['AVD'] && !ENV['PACKAGE_UPLOAD']   # Skip APK test run when packaging
+    # Prepare a new AVD in another process to avoid busy waiting
+    android_prepare_device ENV['API'], ENV['ABI'], ENV['AVD'] or abort 'Failed to prepare Android (virtual) device for test run'
   end
   end
-  # Packaging always use Release configuration
-  if ENV['PACKAGE_UPLOAD']
-    $configuration = 'Release'
-    $testing = 0
-  else
-    $configuration = ENV['CI'] && ENV['USE_CCACHE'].to_i > 0 ? 'Release' : 'Debug'  # Aways use a same build configuration to keep ccache's cache size small when on Travis CI
-    # Only 64-bit Linux environment with virtual framebuffer X server support and not MinGW build; or OSX build environment and not iOS build; or Emscripten build environment are capable to run tests
-    $testing = (ENV['LINUX'] && !ENV['URHO3D_64BIT']) || (ENV['OSX'] && ENV['IOS'].to_i != 1) || ENV['HTML5'] ? 1 : 0
-    if $testing
-      ENV['URHO3D_PREFIX_PATH'] = `pwd`.chomp + '/bin'
+  # Temporarily put the logic here for clang-tools migration until everything else are in their places
+  if ENV['URHO3D_BINDINGS']
+    system 'rake make' or abort 'Failed to build or test Urho3D library with annotated source files'
+    system 'rake ci_push_bindings' or abort
+    return 0
+  end
+  # Multi-config CMake generators use different target name than single-config ones for no good reason
+  test = ENV['URHO3D_TESTING'] ? "&& rake make target=#{ENV['OS'] || ENV['XCODE'] ? 'RUN_TESTS' : 'test'}" : ''
+  system "bash -c 'rake make #{test}'" or abort 'Failed to build or test Urho3D library'
+  unless ENV['CI'] && (ENV['IOS'] || ENV['WEB']) && ENV['PACKAGE_UPLOAD']  # Skip scaffolding test when packaging for iOS and Web platform
+    # Alternate to use in-the-source build tree for test coverage
+    ENV['build_tree'] = '.' unless ENV['APPVEYOR']
+    # Ensure the following variables are auto-discovered during scaffolding test
+    ENV['URHO3D_64BIT'] = nil unless ENV['APPVEYOR']    # AppVeyor uses VS generator which always requires URHO3D_64BIT as input variable
+    ['URHO3D_LIB_TYPE', 'URHO3D_OPENGL', 'URHO3D_D3D11', 'URHO3D_SSE', 'URHO3D_DATABASE_ODBC', 'URHO3D_DATABASE_SQLITE'].each { |var| ENV[var] = nil }
+    # Create a new project on the fly that uses newly built Urho3D library in the build tree
+    prefix = ENV['TRAVIS'] ? '../Build/generated/' : ''
+    scaffolding "#{prefix}UsingBuildTree"
+    Dir.chdir "#{prefix}UsingBuildTree" do
+      puts "\nConfiguring downstream project using Urho3D library in its build tree..."
+      system "bash -c 'rake cmake #{generator} URHO3D_HOME=../..#{ENV['TRAVIS'] ? '': '/Build'} URHO3D_LUA=1 && rake make #{test}'" or abort 'Failed to configure/build/test temporary downstream project using Urho3D as external library'
+    end
+    # Staged-install Urho3D SDK when on Travis-CI; normal install when on AppVeyor
+    ENV['DESTDIR'] = ENV['HOME'] || Dir.home if ENV['TRAVIS']
+    wait_for_block("\nInstalling Urho3D SDK to #{ENV['DESTDIR'] ? "#{ENV['DESTDIR']}/usr/local" : 'default system-wide location'}...") {
+      system "bash -c 'rake make target=install >/dev/null'"
+      Thread.current[:exit_code] = $?.exitstatus
+    } or abort 'Failed to install Urho3D SDK'
+    # Create a new project on the fly that uses newly installed Urho3D SDK
+    scaffolding "#{prefix}UsingSDK"
+    Dir.chdir "#{prefix}UsingSDK" do
+      puts "\nConfiguring downstream project using Urho3D SDK..."
+      # SDK installation to a system-wide location does not need URHO3D_HOME to be defined, staged-installation does
+      system "bash -c '#{ENV['DESTDIR'] ? 'URHO3D_HOME=~/usr/local' : ''} rake cmake #{generator} URHO3D_LUA=1 && rake make #{test}'" or abort 'Failed to configure/build/test temporary downstream project using Urho3D as external library'
     end
     end
   end
   end
-  # Define the build option string only when the override environment variable is given
-  $build_options = "-DWIN32=#{ENV['WINDOWS']}" if ENV['WINDOWS']
-  $build_options = "-DEMSCRIPTEN=#{ENV['HTML5']}" if ENV['HTML5']
-  $build_options = "#{$build_options} -DANDROID_ABI=#{ENV['ABI']}" if ENV['ABI']
-  $build_options = "#{$build_options} -DANDROID_NATIVE_API_LEVEL=#{ENV['API']}" if ENV['API']
-  ['URHO3D_64BIT', 'URHO3D_LIB_TYPE', 'URHO3D_PCH', 'URHO3D_BINDINGS', 'URHO3D_OPENGL', 'URHO3D_D3D11', 'URHO3D_TEST_TIMEOUT', 'URHO3D_UPDATE_SOURCE_TREE', 'URHO3D_DEPLOYMENT_TARGET', 'CMAKE_OSX_DEPLOYMENT_TARGET', 'IPHONEOS_DEPLOYMENT_TARGET', 'ANDROID', 'RPI', 'RPI_ABI', 'EMSCRIPTEN_SHARE_DATA', 'EMSCRIPTEN_EMRUN_BROWSER'].each { |var| $build_options = "#{$build_options} -D#{var}=\"#{ENV[var]}\"" if ENV[var] }
-  if ENV['XCODE']
-    # xcodebuild
-    xcode_ci
-  else
-    # GCC or Clang
-    makefile_ci
+  # Make, deploy, and test run Android APK in an Android (virtual) device
+  if ENV['AVD'] && !ENV['PACKAGE_UPLOAD']
+    puts "\nTest deploying and running Urho3D Samples APK..."
+    Dir.chdir '../Build' do
+      system "android update project -p . -t $(android list target |grep android-$ANDROID_NATIVE_API_LEVEL |cut -d ' ' -f2) && ant debug" or abort 'Failed to make Urho3D Samples APK'
+      if android_wait_for_device
+        system "ant -Dadb.device.arg='-s #{$specific_device}' installd" or abort 'Failed to deploy Urho3D Samples APK'
+        android_test_run or abort 'Failed to test run Urho3D Samples APK'
+      else
+        puts 'Skipped test running Urho3D Samples APK as emulator failed to start in time'
+      end
+    end
   end
   end
 end
 end
 
 
@@ -308,7 +351,7 @@ task :ci_site_update do
     append_new_release release or abort 'Failed to add new release to document data file'
     append_new_release release or abort 'Failed to add new release to document data file'
   end
   end
   # Generate and sync doxygen pages
   # Generate and sync doxygen pages
-  system "cd ../Build && make -j$NUMJOBS doc >/dev/null 2>&1 && ruby -i -pe 'gsub(/(<\\/?h)3([^>]*?>)/, %q{\\14\\2}); gsub(/(<\\/?h)2([^>]*?>)/, %q{\\13\\2}); gsub(/(<\\/?h)1([^>]*?>)/, %q{\\12\\2})' Docs/html/_*.html && rsync -a --delete Docs/html/ ../doc-Build/documentation/#{release}" or abort 'Failed to generate/rsync doxygen pages'
+  system "cd ../Build && make -j$numjobs doc >/dev/null 2>&1 && ruby -i -pe 'gsub(/(<\\/?h)3([^>]*?>)/, %q{\\14\\2}); gsub(/(<\\/?h)2([^>]*?>)/, %q{\\13\\2}); gsub(/(<\\/?h)1([^>]*?>)/, %q{\\12\\2})' Docs/html/_*.html && rsync -a --delete Docs/html/ ../doc-Build/documentation/#{release}" or abort 'Failed to generate/rsync doxygen pages'
   # Supply GIT credentials and push site documentation to urho3d/urho3d.github.io.git
   # Supply GIT credentials and push site documentation to urho3d/urho3d.github.io.git
   system "cd ../doc-Build && pwd && git config user.name $GIT_NAME && git config user.email $GIT_EMAIL && git remote set-url --push origin https://[email protected]/urho3d/urho3d.github.io.git && git add -A . && ( git commit -qm \"Travis CI: site documentation update at #{Time.now.utc}.\n\nCommit: https://github.com/$TRAVIS_REPO_SLUG/commit/$TRAVIS_COMMIT\n\nMessage: $COMMIT_MESSAGE\" || true) && git push -q >/dev/null 2>&1" or abort 'Failed to update site'
   system "cd ../doc-Build && pwd && git config user.name $GIT_NAME && git config user.email $GIT_EMAIL && git remote set-url --push origin https://[email protected]/urho3d/urho3d.github.io.git && git add -A . && ( git commit -qm \"Travis CI: site documentation update at #{Time.now.utc}.\n\nCommit: https://github.com/$TRAVIS_REPO_SLUG/commit/$TRAVIS_COMMIT\n\nMessage: $COMMIT_MESSAGE\" || true) && git push -q >/dev/null 2>&1" or abort 'Failed to update site'
   unless ENV['RELEASE_TAG'] || `git fetch -qf origin #{ENV['TRAVIS_BRANCH']}; git log -1 --pretty=format:'%H' FETCH_HEAD` != ENV['TRAVIS_COMMIT']
   unless ENV['RELEASE_TAG'] || `git fetch -qf origin #{ENV['TRAVIS_BRANCH']}; git log -1 --pretty=format:'%H' FETCH_HEAD` != ENV['TRAVIS_COMMIT']
@@ -324,7 +367,7 @@ task :ci_site_update do
 end
 end
 
 
 # Usage: NOT intended to be used manually
 # Usage: NOT intended to be used manually
-desc 'Update Emscripten HTML5 samples to GitHub Pages'
+desc 'Update web samples to GitHub Pages'
 task :ci_emscripten_samples_update do
 task :ci_emscripten_samples_update do
   puts "\nUpdating Emscripten samples in main website..."
   puts "\nUpdating Emscripten samples in main website..."
   # Pull or clone
   # Pull or clone
@@ -344,9 +387,9 @@ task :ci_create_mirrors do
   abort 'Skipped creating mirror branches due to moving HEAD' unless `git fetch -qf origin #{ENV['TRAVIS_PULL_REQUEST'] == 'false' ? ENV['TRAVIS_BRANCH'] : %Q{+refs/pull/#{ENV['TRAVIS_PULL_REQUEST']}/head'}}; git log -1 --pretty=format:'%H' FETCH_HEAD` == ENV['TRAVIS_COMMIT']
   abort 'Skipped creating mirror branches due to moving HEAD' unless `git fetch -qf origin #{ENV['TRAVIS_PULL_REQUEST'] == 'false' ? ENV['TRAVIS_BRANCH'] : %Q{+refs/pull/#{ENV['TRAVIS_PULL_REQUEST']}/head'}}; git log -1 --pretty=format:'%H' FETCH_HEAD` == ENV['TRAVIS_COMMIT']
   system 'git config user.name $GIT_NAME && git config user.email $GIT_EMAIL && git remote set-url --push origin https://[email protected]/$TRAVIS_REPO_SLUG.git'
   system 'git config user.name $GIT_NAME && git config user.email $GIT_EMAIL && git remote set-url --push origin https://[email protected]/$TRAVIS_REPO_SLUG.git'
   # Limit the scanning to only master branch and limit the frequency of scanning
   # Limit the scanning to only master branch and limit the frequency of scanning
-  scan = ENV['TRAVIS_BRANCH'] == 'master' && ((/\[ccache clear\]/ !~ ENV['COMMIT_MESSAGE'] && `ccache -s |grep 'cache miss'`.split.last.to_i >= ENV['COVERITY_SCAN_THRESHOLD'].to_i) || /\[ci scan\]/ =~ ENV['COMMIT_MESSAGE'])
+  scan = ENV['TRAVIS_BRANCH'] == 'master' && ((/\[ccache clear\]/ !~ ENV['COMMIT_MESSAGE'] && `ccache -s |grep 'cache miss'`.split.last.to_i >= ENV['COVERITY_SCAN_THRESHOLD'].to_i) || /\[ci scan\]/ =~ ENV['COMMIT_MESSAGE']) && /\[ci only:.*?\]/ !~ ENV['COMMIT_MESSAGE']
   # Check if it is time to generate annotation
   # Check if it is time to generate annotation
-  annotate = ENV['TRAVIS_BRANCH'] == 'master' && (ENV['PACKAGE_UPLOAD'] || /\[ci annotate\]/ =~ ENV['COMMIT_MESSAGE'])
+  annotate = ENV['TRAVIS_BRANCH'] == 'master' && (ENV['PACKAGE_UPLOAD'] || /\[ci annotate\]/ =~ ENV['COMMIT_MESSAGE']) && /\[ci only:.*?\]/ !~ ENV['COMMIT_MESSAGE']
   # Determine which CI mirror branches to be auto created
   # Determine which CI mirror branches to be auto created
   unless ENV['RELEASE_TAG']
   unless ENV['RELEASE_TAG']
     matched = /\[ci only:(.*?)\]/.match(ENV['COMMIT_MESSAGE'])
     matched = /\[ci only:(.*?)\]/.match(ENV['COMMIT_MESSAGE'])
@@ -383,47 +426,42 @@ desc 'Make binary package and upload it to a designated central hosting server'
 task :ci_package_upload do
 task :ci_package_upload do
   # Skip when :ci rake task was skipped
   # Skip when :ci rake task was skipped
   next unless File.exist?('../Build/CMakeCache.txt')
   next unless File.exist?('../Build/CMakeCache.txt')
-  if ENV['XCODE']
-    $configuration = 'Release'
-    $testing = 0
-  end
+  # Using out-of-source build tree when using Travis-CI
+  ENV['build_tree'] = '../Build' if ENV['TRAVIS']
+  # Aways use Release build configuration when using Xcode
+  ENV['config'] = 'Release' if ENV['XCODE']
   # Generate the documentation if necessary
   # Generate the documentation if necessary
   if ENV['SITE_UPDATE']
   if ENV['SITE_UPDATE']
     if File.exist?('.site_updated')
     if File.exist?('.site_updated')
       # Skip if site is already updated before
       # Skip if site is already updated before
       ENV['SITE_UPDATE'] = nil
       ENV['SITE_UPDATE'] = nil
     end
     end
-  else
-    system 'echo Generating documentation...'
-    if ENV['XCODE']
-      xcode_build(ENV['IOS'], '../Build/Urho3D.xcodeproj', 'doc', '>/dev/null') or abort 'Failed to generate documentation'
-    else
-      system 'cd ../Build && make -j$NUMJOBS doc >/dev/null' or abort 'Failed to generate documentation'
-    end
+  elsif !File.exists?("#{ENV['build_tree']}/Docs/html/index.html")
+    puts "\nGenerating documentation..."
+    # Ignore the exit status from 'make doc' on Windows host system only due to Doxygen may not return exit status correctly on Windows
+    system "bash -c 'rake make target=doc >/dev/null'" or ENV['OS'] or abort 'Failed to generate documentation'
   end
   end
   # Make the package
   # Make the package
   if ENV['IOS']
   if ENV['IOS']
-    # There is a bug in CMake/CPack that causes the 'package' target failed to build for IOS platform, workaround by calling cpack directly
+    # There is a bug in CMake/CPack that causes the 'package' target failed to build for IOS platform, workaround by calling cpack directly; CMake 3.4 runs the target successfully, however, the result tarball is incomplete (somehow it misses packaging the library itself, another bug?)
     system 'cd ../Build && cpack -G TGZ 2>/dev/null' or abort 'Failed to make binary package'
     system 'cd ../Build && cpack -G TGZ 2>/dev/null' or abort 'Failed to make binary package'
-  elsif ENV['XCODE']
-    xcode_build(ENV['IOS'], '../Build/Urho3D.xcodeproj', 'package') or abort 'Failed to make binary package'
   else
   else
     if ENV['ANDROID']
     if ENV['ANDROID']
       if !ENV['NO_SDK_SYSIMG']
       if !ENV['NO_SDK_SYSIMG']
-        system "cd ../Build && android update project -p . -t $(android list target |grep android-$API |cut -d ' ' -f2) && ant debug" or abort 'Failed to make Urho3D Samples APK'
+        system "cd ../Build && android update project -p . -t $(android list target |grep android-$ANDROID_NATIVE_API_LEVEL |cut -d ' ' -f2) && ant debug" or abort 'Failed to make Urho3D Samples APK'
       end
       end
       system 'rm -rf ../Build/generated ~/usr/local $(dirname $(which android))/../*' if ENV['TRAVIS']   # Clean up some disk space before packaging on Travis CI
       system 'rm -rf ../Build/generated ~/usr/local $(dirname $(which android))/../*' if ENV['TRAVIS']   # Clean up some disk space before packaging on Travis CI
     end
     end
     if ENV['URHO3D_USE_LIB64_RPM']
     if ENV['URHO3D_USE_LIB64_RPM']
-      system "cd ../Build && cmake . -DURHO3D_USE_LIB64_RPM=#{ENV['URHO3D_USE_LIB64_RPM']}" or abort 'Failed to reconfigure to generate 64-bit RPM package'
+      system 'rake cmake' or abort 'Failed to reconfigure to generate 64-bit RPM package'
     end
     end
-    wrapper = ENV['URHO3D_64BIT'] || ENV['RPI'] ? 'setarch i686' : ''
-    system "cd ../Build && #{wrapper} make package" or abort 'Failed to make binary package'
+    system "bash -c '#{!ENV['OS'] && (ENV['URHO3D_64BIT'] || ENV['RPI']) ? 'setarch i686' : ''} rake make target=package'" or abort 'Failed to make binary package'
   end
   end
   # Determine the upload location
   # Determine the upload location
   setup_digital_keys
   setup_digital_keys
+  repo = ENV[ENV['TRAVIS'] ? 'TRAVIS_REPO_SLUG' : 'APPVEYOR_REPO_NAME']
   unless ENV['RELEASE_TAG']
   unless ENV['RELEASE_TAG']
-    upload_dir = "/home/frs/project/#{ENV['TRAVIS_REPO_SLUG']}/Snapshots"
+    upload_dir = "/home/frs/project/#{repo}/Snapshots"
     if ENV['SITE_UPDATE']
     if ENV['SITE_UPDATE']
       # Download source packages from GitHub
       # Download source packages from GitHub
       system "export SNAPSHOT_VER=$(git describe $TRAVIS_COMMIT |ruby -pe 'gsub(/-(?!g)/, %q{.})'); wget -q https://github.com/$TRAVIS_REPO_SLUG/tarball/$TRAVIS_COMMIT -O Urho3D-$SNAPSHOT_VER-Source-snapshot.tar.gz && wget -q https://github.com/$TRAVIS_REPO_SLUG/zipball/$TRAVIS_COMMIT -O Urho3D-$SNAPSHOT_VER-Source-snapshot.zip" or abort 'Failed to get source packages'
       system "export SNAPSHOT_VER=$(git describe $TRAVIS_COMMIT |ruby -pe 'gsub(/-(?!g)/, %q{.})'); wget -q https://github.com/$TRAVIS_REPO_SLUG/tarball/$TRAVIS_COMMIT -O Urho3D-$SNAPSHOT_VER-Source-snapshot.tar.gz && wget -q https://github.com/$TRAVIS_REPO_SLUG/zipball/$TRAVIS_COMMIT -O Urho3D-$SNAPSHOT_VER-Source-snapshot.zip" or abort 'Failed to get source packages'
@@ -436,16 +474,16 @@ EOF
 ); do echo rm #{upload_dir}/${v}*; done |sftp -b - [email protected] >/dev/null 2>&1" or abort 'Failed to housekeep snapshots'
 ); do echo rm #{upload_dir}/${v}*; done |sftp -b - [email protected] >/dev/null 2>&1" or abort 'Failed to housekeep snapshots'
     end
     end
   else
   else
-    upload_dir = "/home/frs/project/#{ENV['TRAVIS_REPO_SLUG']}/#{ENV['RELEASE_TAG']}"
+    upload_dir = "/home/frs/project/#{repo}/#{ENV['RELEASE_TAG']}"
     if ENV['SITE_UPDATE']
     if ENV['SITE_UPDATE']
       # Download source packages from GitHub
       # Download source packages from GitHub
       system 'wget -q https://github.com/$TRAVIS_REPO_SLUG/archive/$RELEASE_TAG.tar.gz -O Urho3D-$RELEASE_TAG-Source.tar.gz && wget -q https://github.com/$TRAVIS_REPO_SLUG/archive/$RELEASE_TAG.zip -O Urho3D-$RELEASE_TAG-Source.zip' or abort 'Failed to get source packages'
       system 'wget -q https://github.com/$TRAVIS_REPO_SLUG/archive/$RELEASE_TAG.tar.gz -O Urho3D-$RELEASE_TAG-Source.tar.gz && wget -q https://github.com/$TRAVIS_REPO_SLUG/archive/$RELEASE_TAG.zip -O Urho3D-$RELEASE_TAG-Source.zip' or abort 'Failed to get source packages'
     end
     end
     # Make sure the release directory exists remotely, do this in all the build jobs as we don't know which one would start uploading first
     # Make sure the release directory exists remotely, do this in all the build jobs as we don't know which one would start uploading first
-    system "sftp [email protected] <<EOF >/dev/null 2>&1
+    system "bash -c 'sftp [email protected] <<EOF >/dev/null 2>&1
 mkdir #{upload_dir}
 mkdir #{upload_dir}
 bye
 bye
-EOF" or abort 'Failed to create release directory remotely'
+EOF'" or abort 'Failed to create release directory remotely'
   end
   end
   if ENV['SITE_UPDATE']
   if ENV['SITE_UPDATE']
     # Upload the source package
     # Upload the source package
@@ -461,38 +499,10 @@ EOF" or abort 'Failed to create release directory remotely'
     File.open('.site_updated', 'w') {}
     File.open('.site_updated', 'w') {}
   end
   end
   # Upload the binary package
   # Upload the binary package
-  system "scp ../Build/Urho3D-* [email protected]:#{upload_dir} && rm ../Build/Urho3D-*" or abort 'Failed to upload binary package'
-  if ENV['RELEASE_TAG'] && ENV['SF_DEFAULT']
-    # Mark the corresponding binary package as default download for each Windows/Mac/Linux host systems
-    system "curl -H 'Accept: application/json' -X PUT -d 'default=%s' -d \"api_key=$SF_API\" https://sourceforge.net/projects/%s/files/%s/#{ENV['RELEASE_TAG']}/Urho3D-#{ENV['RELEASE_TAG']}-%s" % ENV['SF_DEFAULT'].split(':').insert(1, ENV['TRAVIS_REPO_SLUG'].split('/')).flatten or abort 'Failed to set binary tarball/zip as default download'
-  end
-end
-
-# Usage: NOT intended to be used manually
-desc 'Make binary package and upload it to a designated central hosting server'
-task :ci_appveyor_package_upload do
-  # Generate the documentation
-  system 'echo Generating documentation...'
-  system "bash -c 'rake make config=$Configuration target=doc >/dev/null'"  # Ignore the exit status from 'make doc' as Doxygen on Windows host system does not return exit status correctly
-  # Make the package
-  system "bash -c 'rake make config=$Configuration target=package'" or abort 'Failed to make binary package'
-  # Determine the upload location
-  setup_digital_keys
-  unless ENV['RELEASE_TAG']
-    upload_dir = "/home/frs/project/#{ENV['APPVEYOR_REPO_NAME']}/Snapshots"
-  else
-    upload_dir = "/home/frs/project/#{ENV['APPVEYOR_REPO_NAME']}/#{ENV['RELEASE_TAG']}"
-    # Make sure the release directory exists remotely, do this in all the build jobs as we don't know which one would start uploading first
-    system "bash -c 'sftp [email protected] <<EOF >/dev/null 2>&1
-mkdir #{upload_dir}
-bye
-EOF'" or abort 'Failed to create release directory remotely'
-  end
-  # Upload the binary package
-  system "bash -c 'scp #{ENV['build_tree']}/Urho3D-* [email protected]:#{upload_dir}'" or abort 'Failed to upload binary package'
+  system "bash -c 'scp #{ENV['build_tree']}/Urho3D-* [email protected]:#{upload_dir} && rm #{ENV['build_tree']}/Urho3D-*'" or abort 'Failed to upload binary package'
   if ENV['RELEASE_TAG'] && ENV['SF_DEFAULT']
   if ENV['RELEASE_TAG'] && ENV['SF_DEFAULT']
     # Mark the corresponding binary package as default download for each Windows/Mac/Linux host systems
     # Mark the corresponding binary package as default download for each Windows/Mac/Linux host systems
-    system "bash -c \"curl -H 'Accept: application/json' -X PUT -d 'default=%s' -d \"api_key=$SF_API\" https://sourceforge.net/projects/%s/files/%s/#{ENV['RELEASE_TAG']}/Urho3D-#{ENV['RELEASE_TAG']}-%s\"" % ENV['SF_DEFAULT'].split(':').insert(1, ENV['APPVEYOR_REPO_NAME'].split('/')).flatten or abort 'Failed to set binary tarball/zip as default download'
+    system "bash -c \"curl -H 'Accept: application/json' -X PUT -d 'default=%s' -d \"api_key=$SF_API\" https://sourceforge.net/projects/%s/files/%s/#{ENV['RELEASE_TAG']}/Urho3D-#{ENV['RELEASE_TAG']}-%s\"" % ENV['SF_DEFAULT'].split(':').insert(1, repo.split('/')).flatten or abort 'Failed to set binary tarball/zip as default download'
   end
   end
 end
 end
 
 
@@ -548,54 +558,6 @@ EOF
   end
   end
 end
 end
 
 
-def makefile_ci
-  if (ENV['WINDOWS'] && ENV['TRAVIS']) || (ENV['ANDROID'] && ENV['ABI'] == 'arm64-v8a') || ENV['HTML5']
-    # LuaJIT on MinGW build is not possible on Travis-CI with Ubuntu 12.04 LTS as its GCC cross-compiler version is too old
-    # The upstream LuaJIT library does not support Android arm64-v8a ABI at the moment
-    # LuaJIT on Emscripten is not possible
-    # Fallback to use Lua library instead
-    jit = ''
-    amalg = ''
-  else
-    jit = 'JIT'
-    amalg = '-DURHO3D_LUAJIT_AMALG=1'
-  end
-  system "./cmake_generic.sh ../Build #{$build_options} -DURHO3D_DATABASE_SQLITE=1 -DURHO3D_LUA#{jit}=1 #{amalg} -DURHO3D_SAMPLES=1 -DURHO3D_TOOLS=1 -DURHO3D_EXTRAS=1 -DURHO3D_TESTING=#{$testing} -DCMAKE_BUILD_TYPE=#{$configuration}" or abort 'Failed to configure Urho3D library build'
-  if ENV['AVD'] && !ENV['PACKAGE_UPLOAD']   # Skip APK test run when packaging
-    android_prepare_device ENV['API'], ENV['ABI'], ENV['AVD'] or abort 'Failed to prepare Android (virtual) device for test run'
-  end
-  # Temporarily put the logic here for clang-tools migration until everything else are in their places
-  if ENV['URHO3D_BINDINGS']
-    system "cd ../Build && make -j$NUMJOBS" or abort 'Failed to build or test Urho3D library with annotated source files'
-    system 'rake ci_push_bindings' or abort
-    return 0
-  end
-  # For Emscripten CI build, skip make test and/or scaffolding test if CI VM took too long to get here, as otherwise overall build time may exceed 50 minutes time limit
-  test = $testing == 1 ? '&& make test' : ''
-  system "cd ../Build && make -j$NUMJOBS #{test}" or abort 'Failed to build or test Urho3D library'
-  unless ENV['CI'] && ENV['HTML5'] && ENV['PACKAGE_UPLOAD']  # For Emscripten, skip scaffolding test when packaging
-    # Create a new project on the fly that uses newly built Urho3D library in the build tree
-    scaffolding "../Build/generated/UsingBuildTree"
-    system "cd ../Build/generated/UsingBuildTree && echo '\nConfiguring downstream project using Urho3D library in its build tree...' && ./cmake_generic.sh . #{$build_options} -DURHO3D_HOME=../.. -DURHO3D_LUA#{jit}=1 -DURHO3D_TESTING=#{$testing} -DCMAKE_BUILD_TYPE=#{$configuration} && make -j$NUMJOBS #{test}" or abort 'Failed to configure/build/test temporary downstream project using Urho3D as external library'
-    ENV['DESTDIR'] = ENV['HOME'] || Dir.home
-    puts "\nInstalling Urho3D SDK to #{ENV['DESTDIR']}/usr/local...\n"  # The default CMAKE_INSTALL_PREFIX is /usr/local
-    system 'cd ../Build && make -j$NUMJOBS install >/dev/null' or abort 'Failed to install Urho3D SDK'
-    # Create a new project on the fly that uses newly installed Urho3D SDK
-    scaffolding "../Build/generated/UsingSDK"
-    system "export URHO3D_HOME=~/usr/local && cd ../Build/generated/UsingSDK && echo '\nConfiguring downstream project using Urho3D SDK...' && ./cmake_generic.sh . #{$build_options} -DURHO3D_LUA#{jit}=1 -DURHO3D_TESTING=#{$testing} -DCMAKE_BUILD_TYPE=#{$configuration} && make -j$NUMJOBS #{test}" or abort 'Failed to configure/build/test temporary downstream project using Urho3D as external library'
-  end
-  # Make, deploy, and test run Android APK in an Android (virtual) device
-  if ENV['AVD'] && !ENV['PACKAGE_UPLOAD']
-    system "echo '\nTest deploying and running Urho3D Samples APK...' && cd ../Build && android update project -p . -t $( android list target |grep android-$API |cut -d ' ' -f2 ) && ant debug" or abort 'Failed to make Urho3D Samples APK'
-    if android_wait_for_device
-      system "cd ../Build && ant -Dadb.device.arg='-s #{$specific_device}' installd" or abort 'Failed to deploy Urho3D Samples APK'
-      android_test_run or abort 'Failed to test run Urho3D Samples APK'
-    else
-      puts 'Skipped test running Urho3D Samples APK as emulator failed to start in time'
-    end
-  end
-end
-
 def get_root_commit_and_recipients
 def get_root_commit_and_recipients
   # Root commit is a commit submitted by human
   # Root commit is a commit submitted by human
   root_commit = `git show -s --format='%H' #{ENV['TRAVIS_COMMIT']}`.rstrip
   root_commit = `git show -s --format='%H' #{ENV['TRAVIS_COMMIT']}`.rstrip
@@ -709,42 +671,6 @@ def wait_for_block comment = '', retries = -1, retry_interval = 60, exit_code_sy
   return retries == 0 ? nil : (exit_code_sym ? thread[exit_code_sym] : 0)
   return retries == 0 ? nil : (exit_code_sym ? thread[exit_code_sym] : 0)
 end
 end
 
 
-def xcode_ci
-  if ENV['IOS']
-    # IOS platform does not support LuaJIT
-    jit = ''
-    amalg = ''
-  else
-    jit = 'JIT'
-    amalg = '-DURHO3D_LUAJIT_AMALG=1'
-  end
-  system "./cmake_macosx.sh ../Build -DIOS=$IOS #{$build_options} -DURHO3D_DATABASE_SQLITE=1 -DURHO3D_LUA#{jit}=1 #{amalg} -DURHO3D_SAMPLES=1 -DURHO3D_TOOLS=1 -DURHO3D_EXTRAS=1 -DURHO3D_TESTING=#{$testing}" or abort 'Failed to configure Urho3D library build'
-  xcode_build(ENV['IOS'], '../Build/Urho3D.xcodeproj') or abort 'Failed to build or test Urho3D library'
-  unless ENV['CI'] && ENV['IOS'] && ENV['PACKAGE_UPLOAD']   # Skip scaffolding test when packaging for iOS
-    # Create a new project on the fly that uses newly built Urho3D library in the build tree
-    scaffolding "../Build/generated/UsingBuildTree"
-    system "cd ../Build/generated/UsingBuildTree && echo '\nConfiguring downstream project using Urho3D library in its build tree...' && ./cmake_macosx.sh . -DIOS=$IOS #{$build_options} -DURHO3D_HOME=../.. -DURHO3D_LUA#{jit}=1 -DURHO3D_TESTING=#{$testing}" or abort 'Failed to configure temporary project using Urho3D as external library'
-    xcode_build(ENV['IOS'], '../Build/generated/UsingBuildTree/Scaffolding.xcodeproj') or abort 'Failed to build/test temporary downstream project using Urho3D as external library'
-    ENV['DESTDIR'] = ENV['HOME'] || Dir.home
-    wait_for_block("\nInstalling Urho3D SDK to #{ENV['DESTDIR']}/usr/local...") { Thread.current[:exit_code] = xcode_build(ENV['IOS'], '../Build/Urho3D.xcodeproj', 'install', '>/dev/null') } or abort 'Failed to install Urho3D SDK'
-    # Create a new project on the fly that uses newly installed Urho3D SDK
-    scaffolding "../Build/generated/UsingSDK"
-    system "export URHO3D_HOME=~/usr/local && cd ../Build/generated/UsingSDK && echo '\nConfiguring downstream project using Urho3D SDK...' && ./cmake_macosx.sh . -DIOS=$IOS #{$build_options} -DURHO3D_LUA#{jit}=1 -DURHO3D_TESTING=#{$testing}" or abort 'Failed to configure temporary downstream project using Urho3D as external library'
-    xcode_build(ENV['IOS'], '../Build/generated/UsingSDK/Scaffolding.xcodeproj') or abort 'Failed to build/test temporary downstream project using Urho3D as external library'
-  end
-end
-
-def xcode_build ios, project, target = 'ALL_BUILD', extras = ''
-  sdk = ios.to_i == 1 ? '-sdk iphonesimulator' : ''
-  # Use xcpretty to filter output from xcodebuild when building
-  system "xcodebuild -project #{project} -target #{target} -configuration #{$configuration} #{sdk} |xcpretty -c #{extras} && exit ${PIPESTATUS[0]}" or return nil
-  if $testing == 1 && target == 'ALL_BUILD'     # Disable testing for other targets such as 'doc', 'package', etc
-    # Use vanila xcodebuild when testing as its output is instantaneous (ensure Travis-CI does not kill the process during testing)
-    system "xcodebuild -project #{project} -target RUN_TESTS -configuration #{$configuration} #{sdk} #{extras}" or return nil
-  end
-  return 0
-end
-
 def append_new_release release, filename = '../doc-Build/_data/urho3d.json'
 def append_new_release release, filename = '../doc-Build/_data/urho3d.json'
   begin
   begin
     urho3d_hash = JSON.parse File.read filename
     urho3d_hash = JSON.parse File.read filename

+ 2 - 2
Source/CMakeLists.txt

@@ -28,7 +28,7 @@ if (HAVE_STDINT_H)
 endif ()
 endif ()
 
 
 # Setup RPATH settings
 # Setup RPATH settings
-if (URHO3D_LIB_TYPE STREQUAL SHARED AND NOT WIN32 AND NOT ANDROID AND NOT IOS AND NOT EMSCRIPTEN)
+if (URHO3D_LIB_TYPE STREQUAL SHARED AND NOT WIN32 AND NOT ANDROID AND NOT IOS AND NOT WEB)
     # Add RPATH entries when building
     # Add RPATH entries when building
     set (CMAKE_SKIP_BUILD_RPATH FALSE)
     set (CMAKE_SKIP_BUILD_RPATH FALSE)
     # But don't set them yet in the build tree
     # But don't set them yet in the build tree
@@ -98,7 +98,7 @@ if (URHO3D_PHYSICS)
     add_subdirectory (ThirdParty/Bullet)
     add_subdirectory (ThirdParty/Bullet)
 endif ()
 endif ()
 
 
-if (NOT IOS AND NOT ANDROID AND NOT RPI AND NOT EMSCRIPTEN)
+if (NOT IOS AND NOT ANDROID AND NOT RPI AND NOT WEB)
     if (URHO3D_OPENGL)
     if (URHO3D_OPENGL)
         add_subdirectory (ThirdParty/GLEW)
         add_subdirectory (ThirdParty/GLEW)
     elseif (NOT URHO3D_D3D11)
     elseif (NOT URHO3D_D3D11)

+ 1 - 1
Source/Samples/19_VehicleDemo/CMakeLists.txt

@@ -27,7 +27,7 @@ set (TARGET_NAME 19_VehicleDemo)
 define_source_files (EXTRA_H_FILES ${COMMON_SAMPLE_H_FILES})
 define_source_files (EXTRA_H_FILES ${COMMON_SAMPLE_H_FILES})
 
 
 # Setup target with resource copying
 # Setup target with resource copying
-if (EMSCRIPTEN)
+if (WEB)
     # Override the Urho3D default
     # Override the Urho3D default
     math (EXPR EMSCRIPTEN_TOTAL_MEMORY "64 * 1024 * 1024")
     math (EXPR EMSCRIPTEN_TOTAL_MEMORY "64 * 1024 * 1024")
     if (URHO3D_TESTING AND URHO3D_TEST_TIMEOUT LESS 15)
     if (URHO3D_TESTING AND URHO3D_TEST_TIMEOUT LESS 15)

+ 1 - 1
Source/Samples/20_HugeObjectCount/CMakeLists.txt

@@ -27,7 +27,7 @@ set (TARGET_NAME 20_HugeObjectCount)
 define_source_files (EXTRA_H_FILES ${COMMON_SAMPLE_H_FILES})
 define_source_files (EXTRA_H_FILES ${COMMON_SAMPLE_H_FILES})
 
 
 # Setup target with resource copying
 # Setup target with resource copying
-if (EMSCRIPTEN)
+if (WEB)
     math (EXPR EMSCRIPTEN_TOTAL_MEMORY "128 * 1024 * 1024")     # Override the Urho3D default
     math (EXPR EMSCRIPTEN_TOTAL_MEMORY "128 * 1024 * 1024")     # Override the Urho3D default
 endif ()
 endif ()
 setup_main_executable ()
 setup_main_executable ()

+ 1 - 1
Source/Samples/23_Water/CMakeLists.txt

@@ -27,7 +27,7 @@ set (TARGET_NAME 23_Water)
 define_source_files (EXTRA_H_FILES ${COMMON_SAMPLE_H_FILES})
 define_source_files (EXTRA_H_FILES ${COMMON_SAMPLE_H_FILES})
 
 
 # Setup target with resource copying
 # Setup target with resource copying
-if (EMSCRIPTEN)
+if (WEB)
     # Override the Urho3D default
     # Override the Urho3D default
     math (EXPR EMSCRIPTEN_TOTAL_MEMORY "64 * 1024 * 1024")
     math (EXPR EMSCRIPTEN_TOTAL_MEMORY "64 * 1024 * 1024")
     if (URHO3D_TESTING AND URHO3D_TEST_TIMEOUT LESS 15)
     if (URHO3D_TESTING AND URHO3D_TEST_TIMEOUT LESS 15)

+ 1 - 1
Source/Samples/41_DatabaseDemo/DatabaseDemo.cpp

@@ -93,7 +93,7 @@ void DatabaseDemo::Start()
     //   and it is designed for development of game server connecting to ODBC-compliant databases in mind
     //   and it is designed for development of game server connecting to ODBC-compliant databases in mind
 
 
     // This demo will always work when using SQLite API as the SQLite database engine is embedded inside Urho3D game engine
     // This demo will always work when using SQLite API as the SQLite database engine is embedded inside Urho3D game engine
-    //   and this is also the case when targeting HTML5 in Emscripten build
+    //   and this is also the case when targeting Web platform
 
 
     // We could have used #ifdef to init the connection string during compile time, but below shows how it is done during runtime
     // We could have used #ifdef to init the connection string during compile time, but below shows how it is done during runtime
     // The "URHO3D_DATABASE_ODBC" compiler define is set when URHO3D_DATABASE_ODBC build option is enabled
     // The "URHO3D_DATABASE_ODBC" compiler define is set when URHO3D_DATABASE_ODBC build option is enabled

+ 1 - 1
Source/ThirdParty/Lua/CMakeLists.txt

@@ -33,7 +33,7 @@ setup_library ()
 install_header_files (DIRECTORY src/ DESTINATION ${DEST_INCLUDE_DIR}/ThirdParty/Lua FILES_MATCHING PATTERN *.h)  # Note: the trailing slash is significant
 install_header_files (DIRECTORY src/ DESTINATION ${DEST_INCLUDE_DIR}/ThirdParty/Lua FILES_MATCHING PATTERN *.h)  # Note: the trailing slash is significant
 
 
 # Setup additional Lua standalone targets (these targets can be transfered and executed on an embedded device, such as Raspberry Pi and Android)
 # Setup additional Lua standalone targets (these targets can be transfered and executed on an embedded device, such as Raspberry Pi and Android)
-if (NOT IOS AND NOT EMSCRIPTEN)
+if (NOT IOS AND NOT WEB)
     # Define target name for Lua interpreter
     # Define target name for Lua interpreter
     set (TARGET_NAME lua_interpreter)   # Note: intended target name is 'lua' which clashes with 'Lua' library target above for case-insensitive platform
     set (TARGET_NAME lua_interpreter)   # Note: intended target name is 'lua' which clashes with 'Lua' library target above for case-insensitive platform
 
 

+ 1 - 1
Source/ThirdParty/LuaJIT/CMakeLists.txt

@@ -407,7 +407,7 @@ setup_library ()
 install_header_files (DIRECTORY src/ DESTINATION ${DEST_INCLUDE_DIR}/ThirdParty/LuaJIT FILES_MATCHING PATTERN *.h *.hpp)  # Note: the trailing slash is significant
 install_header_files (DIRECTORY src/ DESTINATION ${DEST_INCLUDE_DIR}/ThirdParty/LuaJIT FILES_MATCHING PATTERN *.h *.hpp)  # Note: the trailing slash is significant
 
 
 # Setup additional Lua standalone target (this target can be transfered and executed on an embedded device, such as Raspberry Pi and Android)
 # Setup additional Lua standalone target (this target can be transfered and executed on an embedded device, such as Raspberry Pi and Android)
-if (NOT IOS AND NOT EMSCRIPTEN)     # LuaJIT library on Emscripten is not possible anyway but just in case it could be in the future, exclude it to build standalone target
+if (NOT IOS AND NOT WEB)     # LuaJIT library on Emscripten is not possible anyway but just in case it could be in the future, exclude it to build standalone target
     # Define target name for LuaJIT interpreter cum compiler
     # Define target name for LuaJIT interpreter cum compiler
     set (TARGET_NAME luajit_interpreter)   # Note: intended target name is 'luajit' which clashes with 'LuaJIT' library target above for case-insensitive platform
     set (TARGET_NAME luajit_interpreter)   # Note: intended target name is 'luajit' which clashes with 'LuaJIT' library target above for case-insensitive platform
 
 

+ 1 - 1
Source/ThirdParty/SDL/CMakeLists.txt

@@ -23,7 +23,7 @@
 # Define target name
 # Define target name
 set (TARGET_NAME SDL)
 set (TARGET_NAME SDL)
 
 
-if (EMSCRIPTEN)
+if (WEB)
     # Emscripten has its own SDL2 port, so just create a custom target to:
     # Emscripten has its own SDL2 port, so just create a custom target to:
     #  1) Fetch this SDL2 port from its GitHub repository
     #  1) Fetch this SDL2 port from its GitHub repository
     #  2) Install SDL2 headers to the build tree in the post-build step (Note: current configuration uses our own SDL2 header files instead of the ones provided by Emscripten port for no special reason)
     #  2) Install SDL2 headers to the build tree in the post-build step (Note: current configuration uses our own SDL2 header files instead of the ones provided by Emscripten port for no special reason)

+ 2 - 2
Source/ThirdParty/SQLite/CMakeLists.txt

@@ -26,7 +26,7 @@ set (TARGET_NAME sqlite)
 # https://www.sqlite.org/compile.html
 # https://www.sqlite.org/compile.html
 add_definitions (-DSQLITE_USE_URI=1 -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_SOUNDEX)
 add_definitions (-DSQLITE_USE_URI=1 -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_SOUNDEX)
 # Do not use pthread and dl libraries for Emscripten
 # Do not use pthread and dl libraries for Emscripten
-if (EMSCRIPTEN)
+if (WEB)
     add_definitions (-DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION)
     add_definitions (-DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION)
 endif ()
 endif ()
 
 
@@ -40,7 +40,7 @@ setup_library ()
 install_header_files (DIRECTORY src/ DESTINATION ${DEST_INCLUDE_DIR}/ThirdParty/SQLite FILES_MATCHING PATTERN *.h)  # Note: the trailing slash is significant
 install_header_files (DIRECTORY src/ DESTINATION ${DEST_INCLUDE_DIR}/ThirdParty/SQLite FILES_MATCHING PATTERN *.h)  # Note: the trailing slash is significant
 
 
 # Setup additional SQLite CLI standalone target (this target can be transfered and executed on an embedded device, such as Raspberry Pi and Android)
 # Setup additional SQLite CLI standalone target (this target can be transfered and executed on an embedded device, such as Raspberry Pi and Android)
-if (NOT IOS AND NOT EMSCRIPTEN)
+if (NOT IOS AND NOT WEB)
     # Define target name for SQLite shell
     # Define target name for SQLite shell
     set (TARGET_NAME isql)
     set (TARGET_NAME isql)
 
 

+ 1 - 1
Source/Tools/CMakeLists.txt

@@ -28,7 +28,7 @@ find_package (Urho3D REQUIRED)
 include_directories (${URHO3D_INCLUDE_DIRS})
 include_directories (${URHO3D_INCLUDE_DIRS})
 
 
 # Urho3DPlayer target is rather special, although it is here, it is not a tool because it is built into target platform binary as opposed to host platform
 # Urho3DPlayer target is rather special, although it is here, it is not a tool because it is built into target platform binary as opposed to host platform
-if (NOT EMSCRIPTEN)
+if (NOT WEB)
     add_subdirectory (Urho3DPlayer)
     add_subdirectory (Urho3DPlayer)
 endif ()
 endif ()
 
 

+ 1 - 1
Source/Tools/Urho3DPlayer/CMakeLists.txt

@@ -40,7 +40,7 @@ if (URHO3D_LUA)
 endif ()
 endif ()
 
 
 # Symlink/copy helper shell scripts or batch files to invoke Urho3DPlayer
 # Symlink/copy helper shell scripts or batch files to invoke Urho3DPlayer
-if (NOT IOS AND NOT ANDROID AND NOT EMSCRIPTEN AND NOT CMAKE_BINARY_DIR STREQUAL CMAKE_SOURCE_DIR)
+if (NOT IOS AND NOT ANDROID AND NOT WEB AND NOT CMAKE_BINARY_DIR STREQUAL CMAKE_SOURCE_DIR)
     # Ensure the output directory exist before creating the symlinks
     # Ensure the output directory exist before creating the symlinks
     file (MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
     file (MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
     foreach (FILE Editor NinjaSnowWar)
     foreach (FILE Editor NinjaSnowWar)

+ 3 - 3
Source/Urho3D/CMakeLists.txt

@@ -242,7 +242,7 @@ if (IOS)
     set (EXCLUDE_FROM_ALL EXCLUDE_FROM_ALL)
     set (EXCLUDE_FROM_ALL EXCLUDE_FROM_ALL)
 endif ()
 endif ()
 setup_library (${URHO3D_LIB_TYPE} ${EXCLUDE_FROM_ALL})
 setup_library (${URHO3D_LIB_TYPE} ${EXCLUDE_FROM_ALL})
-if (NOT ANDROID AND NOT EMSCRIPTEN)
+if (NOT ANDROID AND NOT WEB)
     file (READ .soversion SOVERSION)
     file (READ .soversion SOVERSION)
     string (STRIP ${SOVERSION} SOVERSION)
     string (STRIP ${SOVERSION} SOVERSION)
     string (REGEX MATCH "([^.]+)\\.([^.]+)\\.(.+)" MATCHED ${SOVERSION})
     string (REGEX MATCH "([^.]+)\\.([^.]+)\\.(.+)" MATCHED ${SOVERSION})
@@ -251,7 +251,7 @@ if (NOT ANDROID AND NOT EMSCRIPTEN)
     else ()
     else ()
         message (FATAL_ERROR "The .soversion file is corrupted. It should contain a version number with this format major(0xFFFF).minor(0xFF).patch-level(0xFF). e.g.: 0.1.2")
         message (FATAL_ERROR "The .soversion file is corrupted. It should contain a version number with this format major(0xFFFF).minor(0xFF).patch-level(0xFF). e.g.: 0.1.2")
     endif ()
     endif ()
-elseif (EMSCRIPTEN)
+elseif (WEB)
     # Emscripten does not support generation of shared library in a conventional sense, it just produces "linked" LLVM bitcode
     # Emscripten does not support generation of shared library in a conventional sense, it just produces "linked" LLVM bitcode
     set (CMAKE_SHARED_LIBRARY_SUFFIX ".bc")
     set (CMAKE_SHARED_LIBRARY_SUFFIX ".bc")
 endif ()
 endif ()
@@ -316,7 +316,7 @@ if (NOT XCODE AND NOT MSVC)
                 COMMAND libtool -static $<TARGET_FILE:${TARGET_NAME}>.engine ${ARCHIVES} -o $<TARGET_FILE:${TARGET_NAME}>
                 COMMAND libtool -static $<TARGET_FILE:${TARGET_NAME}>.engine ${ARCHIVES} -o $<TARGET_FILE:${TARGET_NAME}>
                 COMMAND rm $<TARGET_FILE:${TARGET_NAME}>.engine
                 COMMAND rm $<TARGET_FILE:${TARGET_NAME}>.engine
                 COMMENT "Merging all archives into a single static library using libtool")
                 COMMENT "Merging all archives into a single static library using libtool")
-        elseif (EMSCRIPTEN OR CMAKE_BINARY_DIR MATCHES " ")
+        elseif (WEB OR CMAKE_BINARY_DIR MATCHES " ")
             # Do it the hard way by first extracting the object (bitcode) files and appending them to final archive:
             # Do it the hard way by first extracting the object (bitcode) files and appending them to final archive:
             # a) For Emscripten build as Emscripten emar (llvm-ar) neither takes archives directly as input nor supports MRI-style script
             # a) For Emscripten build as Emscripten emar (llvm-ar) neither takes archives directly as input nor supports MRI-style script
             # b) When the build tree path contains spaces because MRI script does not support spaces in path even with proper escape
             # b) When the build tree path contains spaces because MRI script does not support spaces in path even with proper escape

+ 2 - 2
Source/Urho3D/Core/ProcessUtils.cpp

@@ -151,7 +151,7 @@ void OpenConsoleWindow()
         return;
         return;
 
 
     AllocConsole();
     AllocConsole();
-    
+
     freopen("CONIN$", "r", stdin);
     freopen("CONIN$", "r", stdin);
     freopen("CONOUT$", "w", stdout);
     freopen("CONOUT$", "w", stdout);
 
 
@@ -358,7 +358,7 @@ String GetPlatform()
 #elif defined(RPI)
 #elif defined(RPI)
     return "Raspberry Pi";
     return "Raspberry Pi";
 #elif defined(__EMSCRIPTEN__)
 #elif defined(__EMSCRIPTEN__)
-    return "HTML5";
+    return "Web";
 #elif defined(__linux__)
 #elif defined(__linux__)
     return "Linux";
     return "Linux";
 #else
 #else

+ 1 - 1
Source/Urho3D/Graphics/Direct3D11/D3D11Graphics.h

@@ -321,7 +321,7 @@ public:
     /// Return whether sRGB conversion on rendertarget writing is supported.
     /// Return whether sRGB conversion on rendertarget writing is supported.
     bool GetSRGBWriteSupport() const { return sRGBWriteSupport_; }
     bool GetSRGBWriteSupport() const { return sRGBWriteSupport_; }
 
 
-    /// Return supported fullscreen resolutions. Will be empty if listing the resolutions is not supported on the platform (e.g. HTML5.)
+    /// Return supported fullscreen resolutions. Will be empty if listing the resolutions is not supported on the platform (e.g. Web).
     PODVector<IntVector2> GetResolutions() const;
     PODVector<IntVector2> GetResolutions() const;
     /// Return supported multisampling levels.
     /// Return supported multisampling levels.
     PODVector<int> GetMultiSampleLevels() const;
     PODVector<int> GetMultiSampleLevels() const;

+ 1 - 1
Source/Urho3D/Graphics/Direct3D9/D3D9Graphics.h

@@ -317,7 +317,7 @@ public:
     /// Return whether sRGB conversion on rendertarget writing is supported.
     /// Return whether sRGB conversion on rendertarget writing is supported.
     bool GetSRGBWriteSupport() const { return sRGBWriteSupport_; }
     bool GetSRGBWriteSupport() const { return sRGBWriteSupport_; }
 
 
-    /// Return supported fullscreen resolutions. Will be empty if listing the resolutions is not supported on the platform (e.g. HTML5.)
+    /// Return supported fullscreen resolutions. Will be empty if listing the resolutions is not supported on the platform (e.g. Web).
     PODVector<IntVector2> GetResolutions() const;
     PODVector<IntVector2> GetResolutions() const;
     /// Return supported multisampling levels.
     /// Return supported multisampling levels.
     PODVector<int> GetMultiSampleLevels() const;
     PODVector<int> GetMultiSampleLevels() const;

+ 1 - 1
Source/Urho3D/Graphics/GraphicsDefs.h

@@ -30,7 +30,7 @@ namespace Urho3D
 
 
 class Vector3;
 class Vector3;
 
 
-/// Graphics capability support level. HTML5 (Emscripten) also uses OpenGL ES, but is considered a desktop platform capability-wise
+/// Graphics capability support level. Web platform (Emscripten) also uses OpenGL ES, but is considered a desktop platform capability-wise
 #if defined(ANDROID) || defined(IOS) || defined(RPI)
 #if defined(ANDROID) || defined(IOS) || defined(RPI)
 #define MOBILE_GRAPHICS
 #define MOBILE_GRAPHICS
 #else
 #else

+ 1 - 1
Source/Urho3D/Graphics/OpenGL/OGLGraphics.h

@@ -326,7 +326,7 @@ public:
     /// Return whether sRGB conversion on rendertarget writing is supported.
     /// Return whether sRGB conversion on rendertarget writing is supported.
     bool GetSRGBWriteSupport() const { return sRGBWriteSupport_; }
     bool GetSRGBWriteSupport() const { return sRGBWriteSupport_; }
 
 
-    /// Return supported fullscreen resolutions. Will be empty if listing the resolutions is not supported on the platform (e.g. HTML5.)
+    /// Return supported fullscreen resolutions. Will be empty if listing the resolutions is not supported on the platform (e.g. Web).
     PODVector<IntVector2> GetResolutions() const;
     PODVector<IntVector2> GetResolutions() const;
     /// Return supported multisampling levels.
     /// Return supported multisampling levels.
     PODVector<int> GetMultiSampleLevels() const;
     PODVector<int> GetMultiSampleLevels() const;

+ 1 - 1
bin/Data/LuaScripts/41_DatabaseDemo.lua

@@ -50,7 +50,7 @@ function Start()
     --   and it is designed for development of game server connecting to ODBC-compliant databases in mind
     --   and it is designed for development of game server connecting to ODBC-compliant databases in mind
 
 
     -- This demo will always work when using SQLite API as the SQLite database engine is embedded inside Urho3D game engine
     -- This demo will always work when using SQLite API as the SQLite database engine is embedded inside Urho3D game engine
-    --   and this is also the case when targeting HTML5 in Emscripten build
+    --   and this is also the case when targeting Web platform
 
 
     -- We could have used #ifdef to init the connection string during compile time, but below shows how it is done during runtime
     -- We could have used #ifdef to init the connection string during compile time, but below shows how it is done during runtime
     -- The "URHO3D_DATABASE_ODBC" compiler define is set when URHO3D_DATABASE_ODBC build option is enabled
     -- The "URHO3D_DATABASE_ODBC" compiler define is set when URHO3D_DATABASE_ODBC build option is enabled

+ 1 - 1
bin/Data/Scripts/41_DatabaseDemo.as

@@ -50,7 +50,7 @@ void Start()
     //   and it is designed for development of game server connecting to ODBC-compliant databases in mind
     //   and it is designed for development of game server connecting to ODBC-compliant databases in mind
 
 
     // This demo will always work when using SQLite API as the SQLite database engine is embedded inside Urho3D game engine
     // This demo will always work when using SQLite API as the SQLite database engine is embedded inside Urho3D game engine
-    //   and this is also the case when targeting HTML5 in Emscripten build
+    //   and this is also the case when targeting Web platform
 
 
     // We could have used #ifdef to init the connection string during compile time, but below shows how it is done during runtime
     // We could have used #ifdef to init the connection string during compile time, but below shows how it is done during runtime
     // The "URHO3D_DATABASE_ODBC" compiler define is set when URHO3D_DATABASE_ODBC build option is enabled
     // The "URHO3D_DATABASE_ODBC" compiler define is set when URHO3D_DATABASE_ODBC build option is enabled

+ 1 - 1
cmake_emscripten.bat

@@ -20,4 +20,4 @@
 :: THE SOFTWARE.
 :: THE SOFTWARE.
 ::
 ::
 
 
-@"%~dp0cmake_generic.bat" %* -DEMSCRIPTEN=1
+@"%~dp0cmake_generic.bat" %* -DWEB=1

+ 1 - 1
cmake_emscripten.sh

@@ -21,6 +21,6 @@
 # THE SOFTWARE.
 # THE SOFTWARE.
 #
 #
 
 
-$(dirname $0)/cmake_generic.sh "$@" -DEMSCRIPTEN=1
+$(dirname $0)/cmake_generic.sh "$@" -DWEB=1
 
 
 # vi: set ts=4 sw=4 expandtab:
 # vi: set ts=4 sw=4 expandtab:

+ 2 - 2
cmake_generic.bat

@@ -36,7 +36,7 @@ if "%BUILD%" == "" if exist "%cd%\CMakeCache.txt" (set "BUILD=%cd%") else (goto
 
 
 :: Detect CMake toolchains directory if it is not provided explicitly
 :: Detect CMake toolchains directory if it is not provided explicitly
 if "%TOOLCHAINS%" == "" set "TOOLCHAINS=%SOURCE%\CMake\Toolchains"
 if "%TOOLCHAINS%" == "" set "TOOLCHAINS=%SOURCE%\CMake\Toolchains"
-if not exist "%TOOLCHAINS%" if exist "%URHO3D_HOME%\share\Urho3D\CMake\Toolchains" set "TOOLCHAINS=%URHO3D_HOME%\share\Urho3D\CMake\Toolchains"
+if not exist "%TOOLCHAINS%" if exist "%URHO3D_HOME%\share\CMake\Toolchains" set "TOOLCHAINS=%URHO3D_HOME%\share\CMake\Toolchains"
 :: BEWARE that the TOOLCHAINS variable leaks to caller's environment!
 :: BEWARE that the TOOLCHAINS variable leaks to caller's environment!
 
 
 :: Default to native generator and toolchain if none is specified explicitly
 :: Default to native generator and toolchain if none is specified explicitly
@@ -46,7 +46,7 @@ set "arch="
 :loop
 :loop
 if not "%~1" == "" (
 if not "%~1" == "" (
     if "%~1" == "-DANDROID" if "%~2" == "1" set "OPTS=-G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE="%TOOLCHAINS%\android.toolchain.cmake""
     if "%~1" == "-DANDROID" if "%~2" == "1" set "OPTS=-G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE="%TOOLCHAINS%\android.toolchain.cmake""
-    if "%~1" == "-DEMSCRIPTEN" if "%~2" == "1" set "OPTS=-G "MinGW Makefiles" -DCMAKE_TOOLCHAIN_FILE="%TOOLCHAINS%\emscripten.toolchain.cmake""
+    if "%~1" == "-DWEB" if "%~2" == "1" set "OPTS=-G "MinGW Makefiles" -DCMAKE_TOOLCHAIN_FILE="%TOOLCHAINS%\emscripten.toolchain.cmake""
     if "%~1" == "-DURHO3D_64BIT" if "%~2" == "1" set "arch= Win64"
     if "%~1" == "-DURHO3D_64BIT" if "%~2" == "1" set "arch= Win64"
     if "%~1" == "-DURHO3D_64BIT" if "%~2" == "0" set "arch="
     if "%~1" == "-DURHO3D_64BIT" if "%~2" == "0" set "arch="
     if "%~1" == "-VS" set "OPTS=-G "Visual Studio %~2%arch%""
     if "%~1" == "-VS" set "OPTS=-G "Visual Studio %~2%arch%""

+ 4 - 4
cmake_generic.sh

@@ -51,13 +51,13 @@ for a in $@; do
             ANDROID=1 && OPTS="-DCMAKE_TOOLCHAIN_FILE=$TOOLCHAINS/android.toolchain.cmake"
             ANDROID=1 && OPTS="-DCMAKE_TOOLCHAIN_FILE=$TOOLCHAINS/android.toolchain.cmake"
             ;;
             ;;
         -DRPI=1)
         -DRPI=1)
-            RPI=1 && if [[ ! $(uname -m) =~ ^arm ]]; then OPTS="-DCMAKE_TOOLCHAIN_FILE=$TOOLCHAINS/raspberrypi.toolchain.cmake"; fi
+            if [[ ! $(uname -m) =~ ^arm ]]; then OPTS="-DCMAKE_TOOLCHAIN_FILE=$TOOLCHAINS/raspberrypi.toolchain.cmake"; fi
             ;;
             ;;
         -DWIN32=1)
         -DWIN32=1)
-            WINDOWS=1 && OPTS="-DCMAKE_TOOLCHAIN_FILE=$TOOLCHAINS/mingw.toolchain.cmake"
+            OPTS="-DCMAKE_TOOLCHAIN_FILE=$TOOLCHAINS/mingw.toolchain.cmake"
             ;;
             ;;
-        -DEMSCRIPTEN=1)
-            HTML5=1 && OPTS="-DCMAKE_TOOLCHAIN_FILE=$TOOLCHAINS/emscripten.toolchain.cmake"
+        -DWEB=1)
+            OPTS="-DCMAKE_TOOLCHAIN_FILE=$TOOLCHAINS/emscripten.toolchain.cmake"
             ;;
             ;;
     esac
     esac
 done
 done

+ 0 - 0
cmake_macosx.sh → cmake_xcode.sh