Split module for Linux on Lua and adjust related test cases

This commit is contained in:
samuele3hu 2014-08-06 00:15:44 +08:00
parent d86a37110d
commit 99c52f0102
4 changed files with 188 additions and 35 deletions

View File

@ -1,9 +1,6 @@
set(LUABINDING_SRC
#luacocos2d
set(LIBLUACOCOS2D_SRC
auto/lua_cocos2dx_auto.cpp
auto/lua_cocos2dx_extension_auto.cpp
auto/lua_cocos2dx_studio_auto.cpp
auto/lua_cocos2dx_ui_auto.cpp
auto/lua_cocos2dx_spine_auto.cpp
auto/lua_cocos2dx_physics_auto.cpp
auto/lua_cocos2dx_experimental_auto.cpp
manual/tolua_fix.cpp
@ -12,51 +9,199 @@ set(LUABINDING_SRC
manual/CCLuaStack.cpp
manual/CCLuaValue.cpp
manual/Cocos2dxLuaLoader.cpp
manual/CCBProxy.cpp
manual/LuaOpengl.cpp
manual/LuaScriptHandlerMgr.cpp
manual/LuaBasicConversions.cpp
manual/lua_cocos2dx_manual.cpp
manual/lua_cocos2dx_extension_manual.cpp
manual/lua_cocos2dx_coco_studio_manual.cpp
manual/lua_cocos2dx_ui_manual.cpp
manual/lua_cocos2dx_spine_manual.cpp
manual/lua_cocos2dx_physics_manual.cpp
manual/lua_cocos2dx_deprecated.cpp
manual/lua_xml_http_request.cpp
manual/LuaSkeletonAnimation.cpp
manual/lua_cocos2dx_experimental_manual.cpp
manual/cocos2d/lua_cocos2dx_deprecated.cpp
manual/cocos2d/lua_cocos2dx_experimental_manual.cpp
manual/cocos2d/lua_cocos2dx_manual.cpp
manual/cocos2d/lua_cocos2dx_physics_manual.cpp
manual/cocos2d/LuaOpengl.cpp
manual/cocos2d/LuaScriptHandlerMgr.cpp
)
include_directories(
auto
manual
../../editor-support/cocosbuilder
../../editor-support/cocostudio
../../editor-support/spine
../../ui
manual/cocos2d
manual/extension
manual/cocostudio
manual/ui
../../2d
../../3d
../../../extensions
../../../external/lua/lua
../../../external/lua/tolua
../../../external/xxtea
)
add_library(luabinding STATIC
${LUABINDING_SRC}
add_library(luacocos2d STATIC
${LIBLUACOCOS2D_SRC}
)
target_link_libraries(luabinding
target_link_libraries(luacocos2d
tolua
lua
spine
xxtea
)
set_target_properties(luabinding
set_target_properties(luacocos2d
PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
)
#luacocosdenshion
set(LIBLUACOCOSDENSHION_SRC
auto/lua_cocos2dx_cocosdenshion_auto.cpp
manual/cocosdenshion/lua_cocos2dx_cocosdenshion_manual.cpp
)
include_directories(
auto
manual/cocosdenshion
../../audio/include
)
add_library(luacocosdenshion STATIC
${LIBLUACOCOSDENSHION_SRC}
)
set_target_properties(luacocosdenshion
PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
)
#luanetwork
set(LIBLUANETWORK_SRC
manual/network/lua_cocos2dx_network_manual.cpp
manual/network/lua_xml_http_request.cpp
)
include_directories(
manual/network
../../network
)
add_library(luanetwork STATIC
${LIBLUANETWORK_SRC}
)
set_target_properties(luanetwork
PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
)
#luacocosbuilder
set(LIBLUACOCOSBUILDER_SRC
auto/lua_cocos2dx_cocosbuilder_auto.cpp
manual/cocosbuilder/lua_cocos2dx_cocosbuilder_manual.cpp
manual/cocosbuilder/CCBProxy.cpp
)
include_directories(
auto
manual/cocosbuilder
../../editor-support/cocosbuilder
)
add_library(luacocosbuilder STATIC
${LIBLUACOCOSBUILDER_SRC}
)
set_target_properties(luacocosbuilder
PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
)
#luacocostudio
set(LIBLUACOCOSTUDIO_SRC
auto/lua_cocos2dx_studio_auto.cpp
manual/cocostudio/lua_cocos2dx_coco_studio_manual.cpp
)
include_directories(
auto
manual/cocostudio
../../editor-support/cocostudio
)
add_library(luacocostudio STATIC
${LIBLUACOCOSTUDIO_SRC}
)
set_target_properties(luacocostudio
PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
)
#luaspine
set(LIBLUASPINE_SRC
auto/lua_cocos2dx_spine_auto.cpp
manual/spine/LuaSkeletonAnimation.cpp
manual/spine/lua_cocos2dx_spine_manual.cpp
)
include_directories(
auto
manual/spine
../../editor-support/spine
)
add_library(luaspine STATIC
${LIBLUASPINE_SRC}
)
set_target_properties(luaspine
PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
)
#luaextension
set(LIBLUAEXTENSION_SRC
auto/lua_cocos2dx_extension_auto.cpp
manual/extension/lua_cocos2dx_extension_manual.cpp
)
include_directories(
auto
manual/extension
../../../extensions
)
add_library(luaextension STATIC
${LIBLUAEXTENSION_SRC}
)
set_target_properties(luaextension
PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
)
#luaui
set(LIBLUAUI_SRC
auto/lua_cocos2dx_ui_auto.cpp
manual/ui/lua_cocos2dx_ui_manual.cpp
)
include_directories(
auto
manual/ui
../../ui
)
add_library(luaui STATIC
${LIBLUAUI_SRC}
)
set_target_properties(luaui
PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
)

View File

@ -18,10 +18,9 @@ add_executable(${APP_NAME}
)
target_link_libraries(${APP_NAME}
luabinding
cocostudio
cocosbuilder
extensions
luacocos2d
luacocosdenshion
luanetwork
audio
cocos2d
)

View File

@ -19,12 +19,20 @@ add_executable(${APP_NAME}
)
target_link_libraries(${APP_NAME}
luabinding
luacocos2d
luacocosdenshion
luanetwork
luacocosbuilder
luacocostudio
luaspine
luaextension
luaui
cocos2d
audio
cocostudio
spine
cocosbuilder
extensions
audio
cocos2d
)
set(APP_BIN_DIR "${CMAKE_BINARY_DIR}/bin/${APP_NAME}")

View File

@ -31,13 +31,14 @@ bool AppDelegate::applicationDidFinishLaunching()
lua_State* L = stack->getLuaState();
lua_module_register(L);
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID ||CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC)
lua_getglobal(L, "_G");
if (lua_istable(L,-1))//stack:...,_G,
{
register_assetsmanager_test_sample(L);
}
lua_pop(L, 1);
#endif
pEngine->executeScriptFile("src/controller.lua");