Add support for linking to xcframeworks
Currently it is impossible to generate -G Xcode
project, having dependencies on *.xcframework
s.
Neither find_library
(with PATH_SUFFIXES xcframework
) nor add_library
works correctly with xcframework
s. In case of add_library
manually specified xcframework
just passed to linker as is, which is wrong.
Actually Xcode does the next:
builtin-process-xcframework --xcframework /Users/anatoliy.tomilov/Documents/Projects/vulkansdk-macos-1.2.162.1/MoltenVK/MoltenVK.xcframework --platform ios --target-path /Users/anatoliy.tomilov/Documents/Projects/build-project/bin/Debug
The magic behind builtin-process-xcframework
Xcode command seems simple: it just select subdirs of xcframework
in accordance with selected ARCHS and copies static libraries from them into the build directory. Link command just have: -lMoltenVK
argument.
Edited by Craig Scott