I am building a library using SwiftPM, and it is important for my use case that I link dynamically, so I have a dylib product.
.library(name: "ExampleLib", type: .dynamic, targets: ["ExampleLib"])
When I build the library with swift build
, there is a libExampleLib.dylib
produced in the .build
folder.
However, if I open the Package.swift
file with Xcode and build like usual, there are no .dylib
files produced in the DerivedData
folder. This causes all my tests which rely on dynamic linking to fail because the dylib is not in the products directory.
Is there something I can do to convince Xcode to build the dylibs, or is it necessary to build from the command line?