in Generator/Sources/NeedleFramework/Utilities/SourceKittenFramework/library_wrapper.swift [56:68]
func load(path: String) -> DynamicLinkLibrary {
let fullPaths = searchPaths.map { $0.appending(pathComponent: path) }.filter { $0.isFile }
// try all fullPaths that contains target file,
// then try loading with simple path that depends resolving to DYLD
for fullPath in fullPaths + [path] {
if let handle = dlopen(fullPath, RTLD_LAZY) {
return DynamicLinkLibrary(path: path, handle: handle)
}
}
fatalError("Loading \(path) failed")
}