mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Add AvailabilityMacro feature, kind of
This commit is contained in:
@@ -748,6 +748,19 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
|
||||
|
||||
Opts.Features.insert(*feature);
|
||||
}
|
||||
|
||||
// Hack: In order to support using availability macros in SPM packages, we
|
||||
// need to be able to use:
|
||||
// .enableExperimentalFeature("AvailabilityMacro='...'")
|
||||
// within the package manifest and the feature recognizer can't recognize
|
||||
// this form of feature, so specially handle it here until features can
|
||||
// maybe have extra arguments in the future.
|
||||
auto strRef = StringRef(A->getValue());
|
||||
if (strRef.startswith("AvailabilityMacro=")) {
|
||||
auto availability = strRef.split("=").second;
|
||||
|
||||
Opts.AvailabilityMacros.push_back(availability.str());
|
||||
}
|
||||
}
|
||||
|
||||
// Map historical flags over to future features.
|
||||
|
||||
Reference in New Issue
Block a user