Static Methodswift-package-manager 5.10.1PackageDescription
library(name:type:targets:)
Creates a library product to allow clients that declare a dependency on this package to use the package’s functionality.
Product.swift:138static func library(name: String, type: Library.LibraryType? = nil, targets: [String]) -> Product
Parameters
- name
The name of the library product.
- type
The optional type of the library that’s used to determine how to link to the library. Leave this parameter so Swift Package Manager can choose between static or dynamic linking (recommended). If you don’t support both linkage types, use
static
ordynamic
for this parameter.- targets
The targets that are bundled into a library product.
Returns
A Product
instance.
A library’s product can be either statically or dynamically linked. It’s recommended that you don’t explicitly declare the type of library, so Swift Package Manager can choose between static or dynamic linking based on the preference of the package’s consumer.
See also
class Library
The library product of a Swift package.
Other members in extension
Types
class Executable
The executable product of a Swift package.
class Plugin
The plug-in product of a Swift package.
Type members
static func executable(name: String, targets: [String]
) -> Product Creates an executable package product.
static func plugin(name: String, targets: [String]
) -> Product Defines a product that vends a package plugin target for use by clients of the package.
Instance members
let name: String
The name of the package product.