Skip to content

Installation

Drew Crawford edited this page Aug 17, 2020 · 4 revisions

Installation differs depending on whether you need the Swift (CPU) version, the Metal version, or both.

CPU only

  1. Add a dependency on blitcurve. File->Swift Packages->Add Package Dependencies...
  2. In your target settings, add blitcurve to your "Frameworks, Libraries, and Embedded Content".

Metal only

For Metal, blitcurve must be installed to a known location on disk. For this reason, Xcode's "add package dependencies" cannot be used (FB8102669). For more details, see my metal faq.

  1. First, fix a path for blitcurve relative to your project repository. One way to do this is just to copy the files into your repository. A better way might be git submodules:
    git submodule add https://github.com/drewcrawford/blitcurve.git
    this will place blitcurve in a "blitcurve" directory. For more details on git submodules, see my git submodules faq
  2. Open the blitcurve directory we created in the prior step. Drag blitcurveMetal.xcodeproj underneath your own xcode project. drag
  3. In your target settings, add blitcurve as a dependency. dependency
  4. In your target settings, add path-to-blitcurve/Sources/blitcurve-c/include to "Header Search Paths" under "Metal Compiler - Build Options". Note that this is a different setting from "Header Search Paths" under "Search Paths". search paths
  5. Create a MTLLINKER_FLAGS custom build setting. You can do this from Edit -> Add Build Setting -> Add User Defined Setting. The value for this setting is -L ${BUILT_PRODUCTS_DIR} -l blitcurve-metal. mtllinker_flags

both

  1. Follow the instructions for the Metal only version
  2. Drag the blitcurve folder you created in the prior step underneath your xcodeproject in the lefthand pane. Xcode should recognize this as a Swift package.
  3. In your target settings, add blitcurve to your "Frameworks, Libraries, and Embedded Content".
Clone this wiki locally