heraldofgargos / godot-fmod-integration

FMOD Studio middleware integration and scripting API bindings for the Godot game engine.
MIT License
177 stars 13 forks source link

MacOS @rpath linking #3

Open Edmisten-Sound opened 5 years ago

Edmisten-Sound commented 5 years ago

There is an issue on OSX where FMOD does not properly path to required dynamic libraries. I have a workaround that does work, for sure. I'll include it in this issue. Do you think we could automate this process during the build?

install_name_tool -change @rpath/libfmod.dylib (path to libfmod.dylib) (path to Godot build) install_name_tool -change @rpath/libfmodstudio.dylib (path to libfmodstudio.dylib) (path to Godot build)

piiertho commented 5 years ago

Hi @SGtheoneandonly , with scons you can automate it using sys_exec command. We had the same issue with fmod gdnative, here is a piece of script :

sys_exec(["install_name_tool", "-change", "@rpath/libfmodstudio.dylib", "@loader_path/%s/libfmodstudio.dylib" % fmodLibInstallPath, "bin/libGodotFmod.%s.dylib" % platform])

EDIT : I forgot sys_exec was a method I added in my scons. PR #6 include it in module, I don't know how we can use module scons to make post build operation. If this is possible, we can call install_name_tool using sys_exec.