prefab runs successfully, but my resulting prefab directory only has CMake files in it, no other assets. My goal is to easily share binary assets with colleagues and include them in my Android builds. What am I doing wrong?
I'm attempting to create a prefab of boost (though google might make one if it gets enough votes). I used Boost-for-Android to build boost 1.73.0, copied the relevant includes and libraries out into an assembly directory, populated it with prefab.json, module.json, and abi.json files, and ran
prefab --output "/home/developer/workspace/boost-prefab/out/boost/x86_64" \
--build-system cmake \
--platform android \
--abi "x86_64" \
--os-version "21" \
--ndk-version "21" \
--stl "c++_static" \
"/home/developer/workspace/boost-prefab/assembly/boost"
But the resulting directory only contains two CMake files per abi.
$ find x86_64 -type f
x86_64/lib/x86_64-linux-android/cmake/boost/boostConfig.cmake
x86_64/lib/x86_64-linux-android/cmake/boost/boostConfigVersion.cmake
The assembly directory I created looks like (I followed the prefab structure prescribed in the docs):
boost/prefab.json
modules/filesystem/
module.json
include/boost/...
libs/android.x86_64/
abi.json
libboost_filesystem.a
modules/system/
module.json
include/boost/...
libs/android.x86_64/
abi.json
libboost_system.a
prefab.json:
{"schema_version": 1, "name": "boost", "version": "1.73.0", "dependencies": []}
modules/filesystem/module.json:
{"library_name": "libboost_filesystem"}
modules/filesystem/libs/android.x86_64/abi.json:
{"abi": "x86_64", "api": 21, "ndk": "21", "stl": "c++_static"}
I'll admit I'm confused about prefab's os-version, from what I can tell it's simply the NDK version (because it's not the API version or Android major version number), but I don't think that that's the problem.
I also tried to generate a boost prefab via vcpkg, but boost won't build in vcpkg right now (there are some PRs to address this, but I couldn't get it building.) In any case, vcpkg's example shows a slightly different layout as well where an AAR was inserted into the prefab.
My goal is to have a prebuilt archive of boost that's easy to my colleagues to import into their Android projects.
- Am I simply misunderstanding what a prefab file is for?
- The CMake files that do get generated seem primitive even compared to the default boost ones, i.e. I'd prefer the boost CMake files to the prefab ones being created here
- Should I instead be trying to create an AAR for boost first?
End of the day, the only way I was able to use Boost in my Android project was to include its build in my CMAKE_FIND_ROOT_PATH, but if it comes down to this what's the advantage of prefab? I feel I might as well just integrate conan into my gradle build.