Announcement

Collapse
No announcement yet.

Is there a way to add custom .so?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Is there a way to add custom .so?

    Hi,

    I tried to find information about this but I did not find anything. Is there a way to have custom .so which could be used by our UE application? If so, how? Is there any guide?

    Thanks

    #2
    Hi Wolfgang2k

    What are you trying to add: a plugin, a Third Party Software (TPS) module, or something totally different?

    For example, to add a TPS, you would put it in Engine/Source/ThirdParty/, in its own folder like: Engine/Source/ThirdParty/myNewLibrary

    Then inside it, you would create myNewLibrary.Build.cs that would have references to your lib and include files. I suppose the simplest would be:

    Code:
    using UnrealBuildTool;
    
    public class myNewLibrary : ModuleRules
    {
    	public myNewLibrary(TargetInfo Target)
    	{
    		Type = ModuleType.External;
    
    		string myNewLibraryPath = UEBuildConfiguration.UEThirdPartySourceDirectory + "myNewLibrary/theLibrary";
    		string myNewLibraryLibPath = myNewLibraryPath + "lib/";
    
    		PublicIncludePaths.Add(myNewLibraryPath + "include");
    		
    		if (Target.Platform == UnrealTargetPlatform.Android)
    		{
                            PublicLibraryPaths.Add(myNewLibraryLibPath + "Android/" + Target.Architecture);
    			PublicAdditionalLibraries.Add("myNewLibrary");	
    		}
    	}
    }
    This assumes you put your source files in sub-folder theLibrary/ of that myNewLibrary TPS module, such as theLibrary/include/ for .h files, and theLibrary/lib/Android/x86/ or theLibrary/lib/Android/armeabi-v7a for .so.

    To access this in the engine you would refer to your module by "myNewLibrary" and add it in appropriate engine's .Build.cs part (as private or public), and include "myNewLibrary.h" (or whatever the name is for your definitions) in the code of that engine's part.

    Take a look at Engine/Source/ThirdParty/coremod , it has Android appropriate code and you can use it as a reference, then to find uses in the engine, do a: git grep coremod
    Last edited by amigo; 11-09-2014, 10:12 AM. Reason: Just realized this is about Android not Linux platform - updating to reflect that
    Linux Support page (Wiki): https://wiki.unrealengine.com/Linux_Support
    Linux Demos page (Wiki): https://wiki.unrealengine.com/Linux_Demos
    My Unreal Engine 4 Linux repo: https://github.com/3dluvr/UnrealEngine/

    Comment

    Working...
    X