Forráskód Böngészése

Make the URHO3D_LUA build option available for Emscripten build.

Yao Wei Tjong 姚伟忠 10 éve
szülő
commit
d3f90cbe08

+ 1 - 1
CMake/Modules/Urho3D-CMake-common.cmake

@@ -71,7 +71,7 @@ else ()
     option (URHO3D_64BIT "Enable 64-bit build" ${URHO3D_DEFAULT_64BIT})
 endif ()
 cmake_dependent_option (URHO3D_ANGELSCRIPT "Enable AngelScript scripting support" TRUE "NOT EMSCRIPTEN" FALSE)
-cmake_dependent_option (URHO3D_LUA "Enable additional Lua scripting support" FALSE "NOT EMSCRIPTEN" FALSE)
+option (URHO3D_LUA "Enable additional Lua scripting support")
 cmake_dependent_option (URHO3D_LUAJIT "Enable Lua scripting support using LuaJIT (check LuaJIT's CMakeLists.txt for more options)" FALSE "NOT EMSCRIPTEN" FALSE)
 option (URHO3D_NAVIGATION "Enable navigation support" TRUE)
 cmake_dependent_option (URHO3D_NETWORK "Enable networking support" TRUE "NOT EMSCRIPTEN" FALSE)

+ 1 - 1
Docs/GettingStarted.dox

@@ -220,7 +220,7 @@ Execute cmake_mingw.sh then go to the build tree to execute make command. After
 
 > WHAT DOESN'T WORK:
 >    - Networking. Javascript can only use http and websockets protocols so it's not likely that kNet will ever function.
->    - All the scripting support: AngelScript and Lua/LuaJIT.
+>    - AngelScript scripting support.
 
 This section assumes you have already updated, installed, and activated the latest Emscripten (trans-)compiler toolchain on your host system as per described in http://kripken.github.io/emscripten-site/docs/getting_started/downloads.html.
 

+ 3 - 2
Rakefile

@@ -386,8 +386,9 @@ def makefile_ci
     # LuaJIT on MinGW build is not possible on Ubuntu 12.04 LTS as its GCC cross-compiler version is too old. Fallback to use Lua library instead.
     jit = ''
     amalg = ''
-  elsif ENV['ANDROID'] && ENV['ABI'] == 'arm64-v8a'
-    # The upstream LuaJIT library does not support this Android ABI at the moment, fallback to use Lua library instead
+  elsif (ENV['ANDROID'] && ENV['ABI'] == 'arm64-v8a') || ENV['EMSCRIPTEN']
+    # The upstream LuaJIT library does not support this Android ABI at the moment; LuaJIT on Emscripten is not possible
+    # Fallback to use Lua library instead
     jit = ''
     amalg = ''
   else

+ 4 - 4
Source/Urho3D/CMakeLists.txt

@@ -53,18 +53,18 @@ if (URHO3D_LUA)
     endif ()
 
     # Use the host tool to generate source files for tolua++ API binding
-    file (MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/generated)
+    file (MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/LuaScript/generated)
     file (GLOB API_PKG_FILES LuaScript/pkgs/*.pkg)
     foreach (DIR Navigation Network Physics Urho2D)
         string (TOUPPER URHO3D_${DIR} OPT)
         if (NOT ${OPT})
-            list (REMOVE_ITEM API_PKG_FILES ${CMAKE_CURRENT_SOURCE_DIR}/pkgs/${DIR}LuaAPI.pkg)
+            list (REMOVE_ITEM API_PKG_FILES ${CMAKE_CURRENT_SOURCE_DIR}/LuaScript/pkgs/${DIR}LuaAPI.pkg)
         endif ()
     endforeach ()
     foreach (API_PKG_FILE ${API_PKG_FILES})
         get_filename_component (NAME ${API_PKG_FILE} NAME)
         string (REGEX REPLACE LuaAPI\\.pkg$ "" DIR ${NAME})
-        set (GEN_CPP_FILE generated/${DIR}LuaAPI.cpp)
+        set (GEN_CPP_FILE LuaScript/generated/${DIR}LuaAPI.cpp)
         list (APPEND GEN_CPP_FILES ${GEN_CPP_FILE})
         file (GLOB PKG_FILES LuaScript/pkgs/${DIR}/*.pkg)
         add_custom_command (OUTPUT ${GEN_CPP_FILE}
@@ -74,7 +74,7 @@ if (URHO3D_LUA)
             COMMENT "Generating tolua++ DIR binding on the fly for ${DIR}")
     endforeach ()
 else ()
-    list (APPEND EXCLUDED_SOURCE_DIRS LuaScript generated)
+    list (APPEND EXCLUDED_SOURCE_DIRS LuaScript)
 endif ()
 
 # Generate platform specific export header file