Git Product home page Git Product logo

luajit2vm's People

Contributors

timotimosky avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

luajit2vm's Issues

Unity 2021 build失败

Unity 2017没问题,但是升级到Unity 2021就不行了

build的时候报luaopen_socket_core或者luaopen_cjson找不到之类的error,但是将lua-cjson/luasocket源码放进去编译仍然失败

LuaDLL.cs里看到

        /*
        ** third party library
        */
        ...
        [DllImport(LUADLL, CallingConvention = CallingConvention.Cdecl)]
        public static extern int luaopen_socket_core(IntPtr L);

        [DllImport(LUADLL, CallingConvention = CallingConvention.Cdecl)]
        public static extern int luaopen_mime_core(IntPtr L);

        [DllImport(LUADLL, CallingConvention = CallingConvention.Cdecl)]
        public static extern int luaopen_cjson(IntPtr L);

        [DllImport(LUADLL, CallingConvention = CallingConvention.Cdecl)]
        public static extern int luaopen_cjson_safe(IntPtr L);
        ...

疑问
LuaDLL.cs里指明了需要这些第三方库函数,但是Assets/Plugins/WebGL里只有LuaVM源码,没有lua-cjson/luasocket源码,为什么Unity 2017能够成功build?

toLua框架解析不了LuaJit编译出的字节码问题

你好,我使用这个demo,利用Lua/Build Luajit bundle files (PC) Editor工具打包由Luajit编译的Lua btyescode ab,Assets/Lua/Main.lua会被编译成字节码然后打包进ab:
image

使用Unity版本是2020.3.34fl,修改了测试代码有关Unity版本的编译宏,以跑和Unity2017一样的代码流程。
修改了LuaState源码,直接加载Main.lua:

        void OpenBaseLuaLibs()
        {
            //DoFile("tolua.lua");            //tolua table名字已经存在了,不能用require
            DoFile("Main.lua");
            LuaUnityLibs.OpenLuaLibs(L);
        }

打包webgl平台,起服务器运行,结果Lua解析不了bytescode:
image

相反没有编译bytescode的源码却可以正常解析运行,即利用Lua/Build bundle files not jit打包的lua ab:
image

请问有什么方法可以令这个框架发布webgl平台,正常运行由Luajit编译出的bytescode吗?感谢解答!:heart:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.