swift-webgpu icon indicating copy to clipboard operation
swift-webgpu copied to clipboard

Integration problem

Open SpectralDragon opened this issue 3 years ago • 2 comments

Hi! Thanks for that amazing work! I want to use this library in my project (SPM), but it looks like currently I should run it only under terminal. Can you explain to me how to link this package to a spm project and run it under Xcode? I know that for vulkan I should create a pkg-config file with all header search paths and linker flags, will it work? Also I’ve no idea how to build lib for different architectures (ios/macos/window/linux).

Thanks!

SpectralDragon avatar Feb 15 '23 20:02 SpectralDragon

I haven't actually had much success with getting Xcode / SPM integration to work nicely.

Currently you have to manually provide the include paths for the dawn headers, as well as the path to dawn.json (for source code generation). This is possible through the command line, but unfortunately I haven't yet found away to set these when building within Xcode (which has been frustrating...).

A pkg-config file could be a partial solution - I'll have a play with that to see if I can get anything working.

henrybetts avatar Feb 19 '23 23:02 henrybetts

I used this article to run Vulkan using SPM with pkg-config:

original (currently doesn't load for me) - https://blog.spencerkohan.com/vulkan-swift-linking-moltenvk-using-swift-package-manager

webarch - https://web.archive.org/web/20220823104733/https://blog.spencerkohan.com/vulkan-swift-linking-moltenvk-using-swift-package-manager

SpectralDragon avatar Feb 20 '23 09:02 SpectralDragon