Actually, doing this is possible right now and we do it ourselves 🙂
If you want to build a Universal library (for example the open source glog library), all you need to do is set the following flags in cmake:
-DCMAKE_OSX_ARCHITECTURES="arm64" \
-DCMAKE_HOST_SYSTEM_PROCESSOR="arm64" \
-DCMAKE_SYSTEM_PROCESSOR="arm64"
Once it's built, you can combine it with your other (Intel-based) library into a single Universal library by following the steps listed on Apple's website: https://developer.apple.com/documentation/xcode/building_a_universal_macos_binary?language=objc
Of course the tutorial is meant for combining apps but you can also use it for combining libraries, like so:
x86_lib.dylib: main.c
$(CC) main.c -o x86_lib.dylib -target x86_64-apple-macos10.12
arm_lib.dylib: main.c
$(CC) main.c -o arm_lib.dylib -target arm64-apple-macos11
universal_lib.dylib: x86_lib.dylib arm_lib.dylib
lipo -create -output universal_lib.dylib x86_lib.dylib arm_lib.dylib
It works perfectly on our end.
Hope this helps.