Browse Source

Fixed Lua/LuaJIT compilation issue.

The combined Precompiled header does not include tolua++.h anymore, so it must be included back explicitly.
Yao Wei Tjong 姚伟忠 12 years ago
parent
commit
7785640904

+ 2 - 3
Source/Engine/CMakeLists.txt

@@ -50,16 +50,15 @@ if (WIN32)
 else ()
     set (OBJ_EXT .o)
 endif ()
-
 foreach (TARGET ${STATIC_LIBRARY_TARGETS})
     get_target_property (SOURCES ${TARGET} SOURCES)
     get_target_property (INT_DIR ${TARGET} LOCATION)
     get_filename_component (INT_DIR ${INT_DIR} PATH)
     if (MSVC)
         if (CMAKE_GENERATOR MATCHES "2008")
-            string (REPLACE /$(OutDir) "/${TARGET}.dir/$(ConfigurationName)" INT_DIR ${INT_DIR})
+            string (REPLACE /$(OutDir) /${TARGET}.dir/$(ConfigurationName) INT_DIR ${INT_DIR})
         else ()
-            string (REPLACE /$(Configuration) "/${TARGET}.dir/$(ConfigurationName)" INT_DIR ${INT_DIR})
+            string (REPLACE /$(Configuration) /${TARGET}.dir/$(ConfigurationName) INT_DIR ${INT_DIR})
         endif ()
     else ()
         set (INT_DIR ${INT_DIR}/CMakeFiles/${TARGET}.dir)

+ 1 - 1
Source/Engine/LuaScript/CMakeLists.txt

@@ -63,7 +63,7 @@ set (SOURCE_FILES ${CPP_FILES} ${H_FILES} ${GEN_CPP_FILES})
 # Define dependency libs
 set (LIBS ../../ThirdParty/Lua${JIT}/src)
 set (LINK_LIBS_ONLY tolua++_static)
-set (INCLUDE_DIRS_ONLY . ../Audio ../Container ../Core ../Engine ../Graphics ../Input ../IO ../Math ../Navigation ../Network ../Physics ../Resource ../Scene ../UI
+set (INCLUDE_DIRS_ONLY . .. ../Audio ../Container ../Core ../Engine ../Graphics ../Input ../IO ../Math ../Navigation ../Network ../Physics ../Resource ../Scene ../UI
     ../../ThirdParty/Bullet/src ../../ThirdParty/kNet/include ../../ThirdParty/tolua++/include)
 
 # Setup target

+ 2 - 2
Source/Engine/LuaScript/LuaFunction.cpp

@@ -26,7 +26,6 @@
 #include "LuaScript.h"
 #include "LuaScriptInstance.h"
 #include "VectorBuffer.h"
-#include "tolua++urho3d.h"
 
 extern "C"
 {
@@ -35,6 +34,7 @@ extern "C"
 #include <lauxlib.h>
 }
 #include "tolua++.h"
+#include "tolua++urho3d.h"
 
 #include "DebugNew.h"
 
@@ -208,4 +208,4 @@ bool LuaFunction::PushLuaTable(const String& tableName)
     return true;
 }
 
-}
+}

+ 2 - 1
Source/Engine/LuaScript/pkgs/basic.lua

@@ -84,8 +84,9 @@ function post_output_hook(package)
 //
 
 #include "Precompiled.h"
+#include "tolua++.h"
 #include "tolua++urho3d.h"]]
-      )
+    )
 
     WRITE(result)
 end

+ 1 - 0
Source/Engine/LuaScript/tolua++urho3d.cpp

@@ -22,6 +22,7 @@
 
 #include "Precompiled.h"
 #include "Ptr.h"
+#include "tolua++.h"
 #include "tolua++urho3d.h"
 
 const char* tolua_tourho3dstring(lua_State* L, int narg, const char* def)