Skip to content

Commit

Permalink
iOS: fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
zhongfq committed May 8, 2023
1 parent cb333b0 commit 152a83a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 23 deletions.
2 changes: 2 additions & 0 deletions frameworks/3rd/lua/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ if(WINDOWS)
target_compile_definitions(lua PRIVATE LUA_BUILD_AS_DLL)
elseif(MACOSX)
target_compile_definitions(lua PUBLIC LUA_USE_MACOSX)
elseif(IOS)
target_compile_definitions(lua PUBLIC LUA_USE_IOS)
endif()

source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${LUA_SRC})
23 changes: 0 additions & 23 deletions frameworks/cclua/src/cclua/olua-2dx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,27 +24,10 @@ extern bool olua_throw_error(const char *msg)
}
OLUA_END_DECLS

#if COCOS2D_VERSION < 0x00040000 && defined(CCLUA_OS_WIN32)
#include "base/CCScriptSupport.h"
class AssertEngine : public ScriptEngineProtocol {
public:
virtual int executeString(const char* codes) { return 0; }
virtual int executeScriptFile(const char* filename) { return 0; }
virtual int executeGlobalFunction(const char* functionName) { return 0; }
virtual int sendEvent(ScriptEvent* evt) { return 0; }
virtual bool parseConfig(ConfigType type, const std::string& str) { return true; }

virtual bool handleAssert(const char *msg)
{
return throw_lua_error(msg);
}
};
#else
extern bool cc_assert_script_compatible(const char *msg)
{
return olua_throw_error(msg);
}
#endif

static int _coroutine_resume(lua_State *L)
{
Expand Down Expand Up @@ -334,12 +317,6 @@ lua_State *cclua_new()

lua_pushboolean(L, runtime::isDebug());
lua_setglobal(L, "DEBUG");

#if COCOS2D_VERSION < 0x00040000
#ifdef CCLUA_OS_WIN32
ScriptEngineManager::getInstance()->setScriptEngine(new AssertEngine());
#endif
#endif

return L;
}
Expand Down

0 comments on commit 152a83a

Please sign in to comment.