<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "PackageDescription",
  "identifier" : "/documentation/PackageDescription/Target/systemLibrary(name:path:pkgConfig:providers:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "PackageDescription"
    ],
    "preciseIdentifier" : "s:18PackageDescription6TargetC13systemLibrary4name4path9pkgConfig9providersACSS_SSSgAISayAA06SystemA8ProviderOGSgtFZ"
  },
  "title" : "systemLibrary(name:path:pkgConfig:providers:)"
}
-->

# systemLibrary(name:path:pkgConfig:providers:)

Creates a system library target.

```
static func systemLibrary(name: String, path: String? = nil, pkgConfig: String? = nil, providers: [SystemPackageProvider]? = nil) -> Target
```

## Parameters

`name`

The name of the target.

`path`

The custom path for the target. By default, a targets sources
are expected to be located in the predefined search paths, such as
`[PackageRoot]/Sources/[TargetName]`. Do not escape the package root;
that is, values like `../Foo` or `/Foo` are invalid.

`pkgConfig`

The name of the `pkg-config` file for this system library.

`providers`

The providers for this system library.

## Discussion

Use system library targets to adapt a library installed on the system to
work with Swift packages. Such libraries are generally installed by
system package managers (such as Homebrew and apt-get) and exposed to
Swift packages by providing a `modulemap` file along with other metadata
such as the library’s `pkgConfig` name.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)