NetEase/libpomelo2

Building libpomelo2 unity client?

SamTwining opened this issue · 3 comments

Hello,

First off -- thanks for the great project :) Loving it so far.

I am on OS X and I have followed your steps to build the unity client. So far I have made the xcode proj using command:

gyp --depth=. pomelo.gyp -Duse_sys_openssl=false -Dbuild_cspomelo=true -f xcode

I am able to build in xcode but do not know what should be output and where to proceed from here.

Thank you.

The outputs include several .a files and a .dylib file placed in such as
/Users//Library/Developer/Xcode/DerivedData/<..........>/Build/Products/Default.

Sorry to tell you that we have not provided friendly compilation method for some platforms, because of lacking of time and energy.

The C# binding is contributed by @hbbalfred , and @zhouzizi has compiled libpomelo2 for iOS and Mac desktop successfully #27. So I think they may be helpful to you.

Thanks.

hi sam,
as cynron said you can copy the bundle file into unity project, actually the step is manually for me (if someone have a better way to do it, please tell me thx)

and then .bundle suffix is necessary when unity import the dynamic library in MacOS, so far that is used for build on unity editor.

if you want to build it on android you can execute the build_plugin.sh.
in fact the script compile the lib by android ndk set in your env.

i am sorry for ios where i have no test.
i think it maybe similar as unity editor but put the lib into Assets/Plugins/iOS

hope these can help you:)

Hello @hbbalfred and @cynron !

Thank you very much for your quick response!

These did help a lot -- I had found that renaming .dylib to .bundle had the result I wanted. Mainly I am now stuck on using the library in my Unity project.

I have included the .bundle in the test Unity project here but it looks to be expecting a DllImport of cspomelo, which it does not find and throws DllNotFoundException.

When I rename the build file libcspomelo.bundle to cspomelo.bundle and run the scene, it crashes Unity.

Even trying to use the library in a C# script, I cannot find the reference to include. Am I using the OSX library incorrectly?