fix lua build link on android

This commit is contained in:
halx99 2020-10-19 23:21:40 +08:00
parent 2700d4f300
commit 9e6b360437
14 changed files with 49 additions and 21 deletions

View File

@ -0,0 +1,9 @@
#include "libeditor/WidgetCallBackHandlerProtocol.h"
namespace cocostudio {
WidgetCallBackHandlerProtocol::~WidgetCallBackHandlerProtocol(){}
cocos2d::ui::Widget::ccWidgetTouchCallback WidgetCallBackHandlerProtocol::onLocateTouchCallback(const std::string& callBackName){}
cocos2d::ui::Widget::ccWidgetClickCallback WidgetCallBackHandlerProtocol::onLocateClickCallback(const std::string& callBackName){}
cocos2d::ui::Widget::ccWidgetEventCallback WidgetCallBackHandlerProtocol::onLocateEventCallback(const std::string& callBackName){}
}

View File

@ -34,8 +34,7 @@ namespace cocostudio {
class CCS_DLL WidgetCallBackHandlerProtocol
{
public:
WidgetCallBackHandlerProtocol() {};
virtual ~WidgetCallBackHandlerProtocol() {};
virtual ~WidgetCallBackHandlerProtocol();
virtual cocos2d::ui::Widget::ccWidgetTouchCallback onLocateTouchCallback(const std::string& callBackName);
virtual cocos2d::ui::Widget::ccWidgetClickCallback onLocateClickCallback(const std::string& callBackName);

View File

@ -42,6 +42,14 @@ static void onLoadSpriteFramesWithFileDummy(std::string&)
{
}
namespace cocostudio
{
NodeReaderProtocol::NodeReaderProtocol() {};
NodeReaderProtocol::~NodeReaderProtocol() {};
void NodeReaderProtocol::setCurrentCustomClassName(const char* className) {};
}
namespace cocos2d {
namespace wext {
bool(*onBeforeLoadObjectAsset)(cocos2d::Node*, cocos2d::ResourceData& assets, int index/*= 0*/) = &onLoadObjectAssetDummy;

View File

@ -75,10 +75,10 @@ namespace cocostudio
class CCS_DLL NodeReaderProtocol
{
public:
NodeReaderProtocol() {};
virtual ~NodeReaderProtocol() {};
NodeReaderProtocol();
virtual ~NodeReaderProtocol();
virtual void setCurrentCustomClassName(const char* className) {};
virtual void setCurrentCustomClassName(const char* className);
virtual flatbuffers::Offset<flatbuffers::Table> createOptionsWithFlatBuffers(pugi::xml_node objectData,
flatbuffers::FlatBufferBuilder* builder) = 0;
virtual void setPropsWithFlatBuffers(cocos2d::Node* node, const flatbuffers::Table* nodeOptions) = 0;

View File

@ -0,0 +1,8 @@
#include "libeditor/WidgetReader/WidgetReaderProtocol.h"
namespace cocostudio
{
WidgetReaderProtocol::~WidgetReaderProtocol(){}
void WidgetReaderProtocol::setPropsFromProtocolBuffers(cocos2d::ui::Widget* widget, const protocolbuffers::NodeTree& nodeTree){}
void WidgetReaderProtocol::setPropsFromXML(cocos2d::ui::Widget* widget, pugi::xml_node objectData){}
}

View File

@ -55,11 +55,11 @@ namespace cocostudio
class CCS_DLL WidgetReaderProtocol
{
public:
virtual ~WidgetReaderProtocol() {};
virtual ~WidgetReaderProtocol();
virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options) = 0;
virtual void setPropsFromBinary(cocos2d::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* pCocoNode) = 0;
virtual void setPropsFromProtocolBuffers(cocos2d::ui::Widget* widget, const protocolbuffers::NodeTree& nodeTree){}; // cocos2d-x-3.3rc1@libccs19 spec
virtual void setPropsFromXML(cocos2d::ui::Widget* widget, pugi::xml_node objectData){}; // cocos2d-x-3.3rc1@libccs19 spec
virtual void setPropsFromProtocolBuffers(cocos2d::ui::Widget* widget, const protocolbuffers::NodeTree& nodeTree); // cocos2d-x-3.3rc1@libccs19 spec
virtual void setPropsFromXML(cocos2d::ui::Widget* widget, pugi::xml_node objectData); // cocos2d-x-3.3rc1@libccs19 spec
};
}

View File

@ -137,16 +137,6 @@ elseif(ANDROID)
)
endif()
option(BUILD_YASIO_LUA "Build yasio with cclua support" ON)
if(BUILD_YASIO_LUA)
set(lua_bindings_files
${lua_bindings_files}
${cocos_root}/external/yasio/bindings/lyasio.cpp
${cocos_root}/external/yasio/bindings/yasio_cclua.cpp)
endif()
set(lua_bindings_files
${lua_bindings_manual_files}
${lua_bindings_auto_files}
@ -158,6 +148,16 @@ set(lua_bindings_headers
${COCOS_DEPRECATED_HEADER}
)
option(BUILD_YASIO_LUA "Build yasio with cclua support" ON)
if(BUILD_YASIO_LUA)
message(STATUS "BUILD_YASIO_LUA=${BUILD_YASIO_LUA}")
set(lua_bindings_files
${lua_bindings_files}
"${cocos_root}/external/yasio/bindings/lyasio.cpp"
"${cocos_root}/external/yasio/bindings/yasio_cclua.cpp")
endif()
list(APPEND lua_bindings_files ${lua_bindings_headers})
set(EGNX_LUA_LIB luacocos2d CACHE INTERNAL "The EGNX lua bindings lib name" )

View File

@ -14,7 +14,7 @@ add_library(${target_name} STATIC
${${target_name}_src}
)
get_target_property(lua_header ext_luajit INTERFACE_INCLUDE_DIRECTORIES)
get_target_property(lua_header ${LUA_ENGINE} INTERFACE_INCLUDE_DIRECTORIES)
get_target_property(tolua_header tolua INTERFACE_INCLUDE_DIRECTORIES)
target_include_directories(${target_name}
PRIVATE ../../..

View File

@ -39,6 +39,7 @@ if(NOT DEFINED BUILD_ENGINE_DONE) # to test HelloCpp into root project
if(NOT ("$ENV{COCOS2DX_ROOT}" STREQUAL ""))
message(STATUS "Using system env var COCOS2DX_ROOT=$ENV{COCOS2DX_ROOT}")
set(COCOS2DX_ROOT_PATH "$ENV{COCOS2DX_ROOT}")
string(REPLACE "\\" "/" COCOS2DX_ROOT_PATH ${COCOS2DX_ROOT_PATH})
else()
message(FATAL_ERROR "Please add system env var 'COCOS2DX_ROOT' to specific the engine root")
endif()

View File

@ -36,6 +36,7 @@ endif()
if(NOT ("$ENV{COCOS2DX_ROOT}" STREQUAL ""))
message(STATUS "Using system env var COCOS2DX_ROOT=$ENV{COCOS2DX_ROOT}")
set(COCOS2DX_ROOT_PATH "$ENV{COCOS2DX_ROOT}")
string(REPLACE "\\" "/" COCOS2DX_ROOT_PATH ${COCOS2DX_ROOT_PATH})
else()
message(FATAL_ERROR "Please add system env var 'COCOS2DX_ROOT' to specific the engine root")
endif()

View File

@ -85,8 +85,7 @@ bool AppDelegate::applicationDidFinishLaunching()
register_all_packages();
LuaStack* stack = engine->getLuaStack();
stack->setXXTEAKeyAndSign("2dxLua", strlen("2dxLua"), "XXTEA", strlen("XXTEA"));
//register custom function
//LuaStack* stack = engine->getLuaStack();
//register_custom_function(stack->getLuaState());

View File

@ -14,6 +14,7 @@ if(NOT DEFINED BUILD_ENGINE_DONE)
if(NOT ("$ENV{COCOS2DX_ROOT}" STREQUAL ""))
message(STATUS "Using system env var COCOS2DX_ROOT=$ENV{COCOS2DX_ROOT}")
set(COCOS2DX_ROOT_PATH "$ENV{COCOS2DX_ROOT}")
string(REPLACE "\\" "/" COCOS2DX_ROOT_PATH ${COCOS2DX_ROOT_PATH})
else()
set(COCOS2DX_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../..)
endif()

View File

@ -37,6 +37,7 @@ if(NOT DEFINED BUILD_ENGINE_DONE)
if(NOT ("$ENV{COCOS2DX_ROOT}" STREQUAL ""))
message(STATUS "Using system env var COCOS2DX_ROOT=$ENV{COCOS2DX_ROOT}")
set(COCOS2DX_ROOT_PATH "$ENV{COCOS2DX_ROOT}")
string(REPLACE "\\" "/" COCOS2DX_ROOT_PATH ${COCOS2DX_ROOT_PATH})
else()
set(COCOS2DX_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../..)
endif()

View File

@ -14,6 +14,7 @@ if(NOT DEFINED BUILD_ENGINE_DONE)
if(NOT ("$ENV{COCOS2DX_ROOT}" STREQUAL ""))
message(STATUS "Using system env var COCOS2DX_ROOT=$ENV{COCOS2DX_ROOT}")
set(COCOS2DX_ROOT_PATH "$ENV{COCOS2DX_ROOT}")
string(REPLACE "\\" "/" COCOS2DX_ROOT_PATH ${COCOS2DX_ROOT_PATH})
else()
set(COCOS2DX_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../..)
endif()