
[ad_1]
I need to create a NPM package containing a package for Unity. I need to use native code, i. e. a native library. The package needs to support:
- Windows x86 64bit
- Linux x86 64bit
- Embedded Linux ARM
I have written the code for the three native libraries and the C# glue code. Each library is in its own subdirectory inside of the package folder structure and Unity has generated a meta file each time. I. e., I have
<package root>/
├── package.json
├── README.md
├── (other files)
└── assets/
├── Runtime.meta
└── Runtime/
└── Plugins/
├── arm.meta
├── arm/
│ ├── libConnect.so
│ └── libConnect.so.meta
├── linux.meta
├── linux/
│ ├── libConnect.so
│ └── libConnect.so.meta
├── windows.meta
└── windows/
├── Connect.DLL
└── Connect.DLL.meta
Depending on the platform I build for, I’d like Unity to use the appropriate native library.
However, I can’t seem to set the properties on the native libs to the right values using the Unity Inspector on the libraries. In particular, I cannot seem to set the Embedded Linux ARM lib to ARM CPU without the Linux lib also changing to ARM CPU. Vice versa, changint the Linux lib to “Intel 64-bit” CPU also sets the Embedded Linux ARM lib to that CPU. Also, the windows DLL always seems to end up in Embedded Linux builds, no matter what settings I use. I tried in- and excluding different platforms for different libs, but still, changes to one lib seem to magically mess up changes I made to the other libs.
Please tell me how I can achive my goal, to have three native libs for different platforms and have Unity use the right one depending on which platform I build for.
[ad_2]