---
title: "define(_:to:_:)"
framework: swift-package-manager
role: symbol
role_heading: Type Method
path: "swift-package-manager/documentation/packagedescription/csetting/define(_:to:_:)"
---

# define(_:to:_:)

Defines a value for a macro.

## Declaration

```swift
static func define(_ name: String, to value: String? = nil, _ condition: BuildSettingCondition? = nil) -> CSetting
```

## Parameters

- `name`: The name of the macro.
- `value`: The value of the macro.
- `condition`: A condition that restricts the use of the build setting.

## Discussion

Discussion If you don’t specify a value, the macro’s default value is 1. note: First available in PackageDescription 5.0.

## See Also

### Configuring C Settings

- [headerSearchPath(_:_:)](swift-package-manager/documentation/packagedescription/csetting/headersearchpath(_:_:).md)
- [unsafeFlags(_:_:)](swift-package-manager/documentation/packagedescription/csetting/unsafeflags(_:_:).md)
