From 6eeb2201a99fd68dc490e35c56c6bf08afba5660 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Thu, 9 May 2019 18:43:39 +0200 Subject: [PATCH] [mtouch] Move string null/empty check into CompilerFlags.AddOtherFlag. (#6027) --- tools/common/CompilerFlags.cs | 2 ++ tools/mtouch/Target.cs | 9 +++------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/tools/common/CompilerFlags.cs b/tools/common/CompilerFlags.cs index 55b0fcf620..ba412defd5 100644 --- a/tools/common/CompilerFlags.cs +++ b/tools/common/CompilerFlags.cs @@ -101,6 +101,8 @@ namespace Xamarin.Utils public void AddOtherFlag (string flag) { + if (string.IsNullOrEmpty (flag)) + return; if (OtherFlags == null) OtherFlags = new HashSet (); OtherFlags.Add (flag); diff --git a/tools/mtouch/Target.cs b/tools/mtouch/Target.cs index e91e8ab413..7225d3ce61 100644 --- a/tools/mtouch/Target.cs +++ b/tools/mtouch/Target.cs @@ -1137,10 +1137,8 @@ namespace Xamarin.Bundler } } } - if (App.Embeddinator) { - if (!string.IsNullOrEmpty (App.UserGccFlags)) - compiler_flags.AddOtherFlag (App.UserGccFlags); - } + if (App.Embeddinator) + compiler_flags.AddOtherFlag (App.UserGccFlags); compiler_flags.LinkWithMono (); compiler_flags.LinkWithXamarin (); if (GetAllSymbols ().Contains ("UIApplicationMain")) @@ -1558,8 +1556,7 @@ namespace Xamarin.Bundler linker_flags.AddLinkWith (libilgen); } - if (!string.IsNullOrEmpty (App.UserGccFlags)) - linker_flags.AddOtherFlag (App.UserGccFlags); + linker_flags.AddOtherFlag (App.UserGccFlags); if (App.DeadStrip) linker_flags.AddOtherFlag ("-dead_strip");