Static Methodswift-package-manager 6.0.1PackageDescription
define(_:_:)
Defines a compilation condition.
BuildSettings.swift:288- SwiftPM
- 5.0+
static func define(_ name: String, _ condition: BuildSettingCondition? = nil) -> SwiftSetting
Parameters
Use compilation conditions to only compile statements if a certain condition is true. For example, the Swift compiler will only compile the statements inside the #if
block when ENABLE_SOMETHING
is defined:
#if ENABLE_SOMETHING
...
#endif
Unlike macros in C/C++, compilation conditions don’t have an associated value.
See also
static func unsafeFlags([String], BuildSettingCondition?
) -> SwiftSetting Set unsafe flags to pass arbitrary command-line flags to the corresponding build tool.
Other members in extension
Types
Type members
static func enableExperimentalFeature(String, BuildSettingCondition?
) -> SwiftSetting Enable an experimental feature with the given name.
static func enableUpcomingFeature(String, BuildSettingCondition?
) -> SwiftSetting Enable an upcoming feature with the given name.
static func interoperabilityMode(InteroperabilityMode, BuildSettingCondition?
) -> SwiftSetting Enable Swift interoperability with a given language.
static func swiftLanguageMode(SwiftLanguageMode, BuildSettingCondition?
) -> SwiftSetting Defines a
-language-mode
to pass to the corresponding build tool.
Show obsolete interfaces (1)
Hide obsolete interfaces
static func swiftLanguageVersion(SwiftVersion, BuildSettingCondition?
) -> SwiftSetting Defines a
-swift-version
to pass to the corresponding build tool.