-
Notifications
You must be signed in to change notification settings - Fork 1
Add general #if conditional compilation block (IfConfig) #140
Copy link
Copy link
Open
Description
Summary
Currently IfConfig (formerly IfCanImport) only supports #if canImport(Module). It should be expanded into a general-purpose conditional compilation block covering all Swift #if condition types.
Conditions to Support
.canImport("UIKit")→#if canImport(UIKit)(already works).flag("DEBUG")→#if DEBUG.os(.iOS)/.os(.macOS)/.os(.Linux)/.os(.Windows)etc..targetEnvironment(.simulator)/.targetEnvironment(.macCatalyst).swift(>=6.0)— Swift version check.compiler(>=6.0)— compiler version check.arch(.arm64)/.arch(.x86_64).hasFeature(...)/.hasAttribute(...)- Boolean combinations:
&&,||,!
Clauses
#elseifsupport (additionalIfConfigClauseSyntaxentries)#elsesupport
Related
#warning("message")and#error("message")could be added as separateCompilerWarning/CompilerErrortypes usingPoundDiagnosticDeclSyntax
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels