How to create universal executables via Swift Package Manager

i have one problem with creating universal libraries via Swift Package Manager. I am trying do it with next command:
Code Block
swift build -c release --arch arm64 --arch x86_64 --package-path "package-path" -Xcc -DFUSE_USE_VERSION=26 -Xcc -D_FILE_OFFSET_BITS=64 -Xswiftc -I"headers-include-path" -Xlinker -L"linker-path"

I get errors related to unfound header files. Seems build options don't applied. But if i execute separately with --arch arm64 or --arch x86_64, it works. May be anyone know how to fix it?
I don't know how to fix it, but I can confirm that I have the same problem. -Xcc, -Xswiftc, and -Xlinker seem to be ignored when both --arch arm64 and --arch x86_64 are used at the same time.

Update: As a workaround, I am building one architecture at a time and then merging them with lipo:

Code Block
lipo -create myIntelBinary myArmBinary -output myUniversalBinary


Thanks for your answer. Yes, i tried this, but after adding universal binary to my project i get errors "No such module..." when trying import any target described in Package.swift from binary
How to create universal executables via Swift Package Manager
 
 
Q