---
title: "unsafeFlags(_:_:)"
framework: packagedescription
role: symbol
role_heading: Type Method
path: "packagedescription/cxxsetting/unsafeflags(_:_:)"
---

# unsafeFlags(_:_:)

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

## Declaration

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

## Parameters

- `flags`: The unsafe flags to set.
- `condition`: A condition that restricts the application of the build setting.

## Discussion

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, you can’t use products with unsafe build flags as dependencies in another package. note: First available in PackageDescription 5.0.

## See Also

### Configuring CXX Settings

- [define(_:to:_:)](packagedescription/cxxsetting/define(_:to:_:).md)
- [headerSearchPath(_:_:)](packagedescription/cxxsetting/headersearchpath(_:_:).md)
