<!--
{
  "availability" : [
    "SwiftPM: 5.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "PackageDescription",
  "identifier" : "/documentation/PackageDescription/CSetting/unsafeFlags(_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "PackageDescription"
    ],
    "preciseIdentifier" : "s:18PackageDescription8CSettingV11unsafeFlagsyACSaySSG_AA21BuildSettingConditionVSgtFZ"
  },
  "title" : "unsafeFlags(_:_:)"
}
-->

# unsafeFlags(_:_:)

Sets unsafe flags to pass arbitrary command-line flags to the
corresponding build tool.

```
static func unsafeFlags(_ flags: [String], _ condition: BuildSettingCondition? = nil) -> CSetting
```

## Parameters

`flags`

The unsafe flags to set.

`condition`

A condition that restricts the application of the build
setting.

## Discussion

As the usage of the word “unsafe” implies, Swift Package Manager can’t safely determine
if the build flags have any negative side effect on the build since
certain flags can change the behavior of how it performs a build.

As some build flags can be exploited for unsupported or malicious
behavior, the use of unsafe flags makes the products containing this
target ineligible for use by other packages.

> Since: First available in PackageDescription 5.0.

---

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)