jeffrey
jeffrey

Reputation: 183

swift package manager link dynamic lib

i used swift on linux, made the Package.swift file including some libraries, but when i built the project with swift build command, the libraries were static linked with the executable file. i tried to generated a Xcode project used the swift package generate-xcodeproj command, built the project in Xcode, then opened the Product directory, i found that the libraries were dynamic linked with the executable file, what did the Xcode doing? and how can i build it as a dynamic link use swift build command, could you help meπŸ˜”πŸ˜”

Upvotes: 0

Views: 1523

Answers (1)

Bouke
Bouke

Reputation: 12158

SwiftPM version 3 was only able to build executables with statically linked libraries. In SwiftPM version 4 (currently in beta, will be released this fall) you can also build with dynamically linked libraries. See SE-0146 for more information.

Upvotes: 1

Related Questions