[bgen] Refactor a bit to not use target framework string comparison when we can use an enum. (#8018)

More future-proof, because new and different target frameworks will be
introduced in the future with .NET 5.

Also: fewer string comparisons is always good.
This commit is contained in:
Rolf Bjarne Kvinge 2020-03-02 08:42:33 +01:00 коммит произвёл GitHub
Родитель 8664a96f72
Коммит c673a01652
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 5 добавлений и 5 удалений

Просмотреть файл

@ -323,8 +323,8 @@ public class BindingTouch {
if (!target_framework.HasValue)
throw ErrorHelper.CreateError (86);
switch (target_framework.Value.Identifier.ToLowerInvariant ()) {
case "xamarin.ios":
switch (target_framework.Value.Platform) {
case ApplePlatform.iOS:
CurrentPlatform = PlatformName.iOS;
nostdlib = true;
if (string.IsNullOrEmpty (baselibdll))
@ -332,7 +332,7 @@ public class BindingTouch {
references.Add ("Facades/System.Drawing.Common");
ReferenceFixer.FixSDKReferences (GetSDKRoot (), "lib/mono/Xamarin.iOS", references);
break;
case "xamarin.tvos":
case ApplePlatform.TVOS:
CurrentPlatform = PlatformName.TvOS;
nostdlib = true;
if (string.IsNullOrEmpty (baselibdll))
@ -340,7 +340,7 @@ public class BindingTouch {
references.Add ("Facades/System.Drawing.Common");
ReferenceFixer.FixSDKReferences (GetSDKRoot (), "lib/mono/Xamarin.TVOS", references);
break;
case "xamarin.watchos":
case ApplePlatform.WatchOS:
CurrentPlatform = PlatformName.WatchOS;
nostdlib = true;
if (string.IsNullOrEmpty (baselibdll))
@ -348,7 +348,7 @@ public class BindingTouch {
references.Add ("Facades/System.Drawing.Common");
ReferenceFixer.FixSDKReferences (GetSDKRoot (), "lib/mono/Xamarin.WatchOS", references);
break;
case "xamarin.mac":
case ApplePlatform.MacOSX:
CurrentPlatform = PlatformName.MacOSX;
nostdlib = true;
if (string.IsNullOrEmpty (baselibdll)) {